feat: add svelte-sonner dependency and enhance NotificationBell component
- Added `svelte-sonner` to dependencies for improved notification handling. - Refactored the `NotificationBell.svelte` component for better readability and maintainability, including code formatting and structure improvements. - Updated `package.json` and `bun.lock` to reflect the new dependency.
This commit is contained in:
@@ -38,7 +38,6 @@ const aposentadoValidator = v.optional(
|
||||
|
||||
export const getAll = query({
|
||||
args: {},
|
||||
returns: v.array(v.any()),
|
||||
handler: async (ctx) => {
|
||||
// Autorização: listar funcionários
|
||||
await ctx.runQuery(internal.permissoesAcoes.assertPermissaoAcaoAtual, {
|
||||
@@ -47,7 +46,7 @@ export const getAll = query({
|
||||
});
|
||||
const funcionarios = await ctx.db.query("funcionarios").collect();
|
||||
// Retornar apenas os campos necessários para listagem
|
||||
return funcionarios.map((f: any) => ({
|
||||
return funcionarios.map((f) => ({
|
||||
_id: f._id,
|
||||
_creationTime: f._creationTime,
|
||||
nome: f.nome,
|
||||
@@ -65,6 +64,7 @@ export const getAll = query({
|
||||
simboloTipo: f.simboloTipo,
|
||||
admissaoData: f.admissaoData,
|
||||
desligamentoData: f.desligamentoData,
|
||||
descricaoCargo: f.descricaoCargo,
|
||||
}));
|
||||
},
|
||||
});
|
||||
@@ -199,7 +199,9 @@ export const create = mutation({
|
||||
.withIndex("by_matricula", (q) => q.eq("matricula", args.matricula))
|
||||
.unique();
|
||||
if (matriculaExists) {
|
||||
throw new Error("Já existe um funcionário com esta matrícula. Por favor, use outra ou deixe em branco.");
|
||||
throw new Error(
|
||||
"Já existe um funcionário com esta matrícula. Por favor, use outra ou deixe em branco."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,7 +328,9 @@ export const update = mutation({
|
||||
.withIndex("by_matricula", (q) => q.eq("matricula", args.matricula))
|
||||
.unique();
|
||||
if (matriculaExists && matriculaExists._id !== args.id) {
|
||||
throw new Error("Já existe um funcionário com esta matrícula. Por favor, use outra ou deixe em branco.");
|
||||
throw new Error(
|
||||
"Já existe um funcionário com esta matrícula. Por favor, use outra ou deixe em branco."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user