feat: add logs

This commit is contained in:
Zamitto
2024-07-12 21:17:20 -03:00
parent 46b12f2bc2
commit 198a283752
3 changed files with 26 additions and 5 deletions

View File

@@ -24,12 +24,18 @@ const getMe = async (
return me;
})
.catch((err) => {
.catch(async (err) => {
if (err instanceof UserNotLoggedInError) {
return null;
}
return userAuthRepository.findOne({ where: { id: 1 } });
const loggedUser = await userAuthRepository.findOne({ where: { id: 1 } });
if (loggedUser) {
return { ...loggedUser, id: loggedUser.userId };
}
return null;
});
};