feat: Refactor order flow initiation logic and enhance UI button styles for better user experience
This commit is contained in:
23
packages/backend/convex/debug.ts
Normal file
23
packages/backend/convex/debug.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { query } from './_generated/server';
|
||||
import { v } from 'convex/values';
|
||||
|
||||
export const inspectOrder = query({
|
||||
args: { pedidoId: v.id('pedidos') },
|
||||
handler: async (ctx, args) => {
|
||||
const pedido = await ctx.db.get(args.pedidoId);
|
||||
const historicoEtapas = await ctx.db
|
||||
.query('pedidoEtapasHistorico')
|
||||
.withIndex('by_pedidoId', (q) => q.eq('pedidoId', args.pedidoId))
|
||||
.collect();
|
||||
|
||||
const etapas = await ctx.db.query('pedidoFluxoEtapa').collect();
|
||||
const transicoes = await ctx.db.query('pedidoFluxoTransicao').collect();
|
||||
|
||||
return {
|
||||
pedido,
|
||||
historicoEtapas,
|
||||
etapasConfiguradas: etapas,
|
||||
transicoesConfiguradas: transicoes
|
||||
};
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user