format
This commit is contained in:
@@ -36,9 +36,8 @@ async function ensurePedidoModalidadeAtaConsistency(
|
||||
for (const item of items) {
|
||||
if (ignoreItemId && item._id === ignoreItemId) continue;
|
||||
|
||||
const normalizedItemAtaId = (('ataId' in item ? item.ataId : undefined) ?? null) as
|
||||
| Id<'atas'>
|
||||
| null;
|
||||
const normalizedItemAtaId = (('ataId' in item ? item.ataId : undefined) ??
|
||||
null) as Id<'atas'> | null;
|
||||
|
||||
if (item.modalidade !== modalidade || normalizedItemAtaId !== normalizedNewAtaId) {
|
||||
throw new Error(
|
||||
@@ -656,12 +655,7 @@ export const addItem = mutation({
|
||||
|
||||
// Regra global: todos os itens do pedido devem ter a mesma
|
||||
// modalidade e a mesma ata (quando houver).
|
||||
await ensurePedidoModalidadeAtaConsistency(
|
||||
ctx,
|
||||
args.pedidoId,
|
||||
args.modalidade,
|
||||
args.ataId
|
||||
);
|
||||
await ensurePedidoModalidadeAtaConsistency(ctx, args.pedidoId, args.modalidade, args.ataId);
|
||||
|
||||
// --- CHECK ANALYSIS / ACCEPTANCE MODE ---
|
||||
if (pedido.status === 'em_analise' || pedido.status === 'aguardando_aceite') {
|
||||
|
||||
Reference in New Issue
Block a user