Acortar codigo
gitea/hedera-web/pipeline/pr-beta This commit looks good Details

This commit is contained in:
William Buezas 2025-03-26 09:31:47 +01:00
parent b691bf2cf4
commit d9445f72e3
1 changed files with 8 additions and 16 deletions

View File

@ -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 {