feat: implement template retrieval by ID and enhance error handling in template display for improved user experience

This commit is contained in:
2025-12-01 19:54:33 -03:00
parent 8fabb4149c
commit 6e836e9eb5
3 changed files with 72 additions and 19 deletions

View File

@@ -32,6 +32,19 @@ export const obterTemplatePorCodigo = query({
},
});
/**
* Obter template por ID
*/
export const obterTemplatePorId = query({
args: {
templateId: v.id("templatesMensagens"),
},
handler: async (ctx, args) => {
const template = await ctx.db.get(args.templateId);
return template;
},
});
/**
* Criar template customizado (apenas TI_MASTER)
*/