feat: Add 'atas' (minutes/records) management feature, and implement various improvements across UI, backend logic, and authentication.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { query, mutation } from './_generated/server';
|
||||
import { v } from 'convex/values';
|
||||
import { mutation, query } from './_generated/server';
|
||||
import { getCurrentUserFunction } from './auth';
|
||||
|
||||
/**
|
||||
@@ -303,9 +303,7 @@ export const remove = mutation({
|
||||
}
|
||||
|
||||
// Verificar se há passos de fluxo vinculados
|
||||
const passosVinculados = await ctx.db
|
||||
.query('flowSteps')
|
||||
.collect();
|
||||
const passosVinculados = await ctx.db.query('flowSteps').collect();
|
||||
const temPassosVinculados = passosVinculados.some((p) => p.setorId === args.id);
|
||||
if (temPassosVinculados) {
|
||||
throw new Error('Não é possível excluir um setor vinculado a passos de fluxo');
|
||||
@@ -315,4 +313,3 @@ export const remove = mutation({
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user