get logged in user id

This commit is contained in:
keyan 2021-06-11 18:12:39 -05:00
parent 9f6b669e42
commit 76eb1fe288
1 changed files with 3 additions and 1 deletions

View File

@ -154,13 +154,15 @@ export default {
meSats: async (item, args, { me, models }) => {
if (!me) return 0
const meFull = await models.user.findUnique({ where: { name: me.name } })
const { sum: { sats } } = await models.vote.aggregate({
sum: {
sats: true
},
where: {
itemId: item.id,
userId: me.id
userId: meFull.id
}
})