diff --git a/src/pages/Admin/ConnectionsView.vue b/src/pages/Admin/ConnectionsView.vue index c5171edd..1dcf4cee 100644 --- a/src/pages/Admin/ConnectionsView.vue +++ b/src/pages/Admin/ConnectionsView.vue @@ -72,22 +72,14 @@ const getConnections = async () => { return; } - const formattedConnections = data - .map(connection => { - const { visitUser = {}, ...rest } = connection; - - const { visitAccess, user, stamp } = visitUser; - const { visitAgent } = visitAccess || {}; - - return { - ...rest, - user, - stamp, - visitAgent - }; - }) - .filter(connection => connection.user); - connections.value = formattedConnections; + connections.value = data + .map(({ visitUser = {}, ...rest }) => ({ + ...rest, + user: visitUser.user, + stamp: visitUser.stamp, + visitAgent: visitUser.visitAccess?.visitAgent + })) + .filter(({ user }) => user); } catch (error) { console.error('Error getting connections:', error); } finally {