Fix types: remove any; clean unused states; add machines summary in unified Users list; capitalize 'Gerenciar usuários'; correct Convex linkUser typing
This commit is contained in:
parent
89c8e0cdb3
commit
8b02b8a564
3 changed files with 58 additions and 153 deletions
|
|
@ -1089,9 +1089,9 @@ export const linkUser = mutation({
|
|||
.first()
|
||||
if (!user) throw new ConvexError("Usuário não encontrado")
|
||||
|
||||
const current = new Set((machine.linkedUserIds ?? []).map((id) => id.id ?? id))
|
||||
const current = new Set<Id<"users">>(machine.linkedUserIds ?? [])
|
||||
current.add(user._id)
|
||||
await ctx.db.patch(machine._id, { linkedUserIds: Array.from(current) as any, updatedAt: Date.now() })
|
||||
await ctx.db.patch(machine._id, { linkedUserIds: Array.from(current), updatedAt: Date.now() })
|
||||
return { ok: true }
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue