fix: clear persona links and use esm vitest config
This commit is contained in:
parent
149d46e7d3
commit
30dd503082
3 changed files with 120 additions and 2 deletions
|
|
@ -915,11 +915,18 @@ export const updatePersona = mutation({
|
|||
nextAssignedRole = trimmedRole || undefined
|
||||
}
|
||||
|
||||
if (personaProvided && !nextPersona) {
|
||||
nextAssignedUserId = undefined
|
||||
nextAssignedEmail = undefined
|
||||
nextAssignedName = undefined
|
||||
nextAssignedRole = undefined
|
||||
}
|
||||
|
||||
if (nextPersona && !nextAssignedUserId) {
|
||||
throw new ConvexError("Associe um usuário ao definir a persona da máquina")
|
||||
}
|
||||
|
||||
if (nextAssignedUserId) {
|
||||
if (nextPersona && nextAssignedUserId) {
|
||||
const assignedUser = await ctx.db.get(nextAssignedUserId)
|
||||
if (!assignedUser) {
|
||||
throw new ConvexError("Usuário vinculado não encontrado")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue