refactor: update fichaPontoPDF and processamento to enhance legend styling and accumulate saldo for all days, improving report accuracy
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
import { v } from 'convex/values';
|
||||
import { mutation } from './_generated/server';
|
||||
import { mutation, type MutationCtx } from './_generated/server';
|
||||
import { authComponent, updatePassword } from './auth';
|
||||
import type { GenericCtx } from '@convex-dev/better-auth';
|
||||
import type { DataModel } from './_generated/dataModel';
|
||||
|
||||
/**
|
||||
* Helper para converter MutationCtx para GenericCtx do better-auth
|
||||
* Os tipos são estruturalmente compatíveis, apenas há diferença nas definições de tipo
|
||||
*/
|
||||
function toGenericCtx(ctx: MutationCtx): GenericCtx<DataModel> {
|
||||
// Os tipos são estruturalmente idênticos, apenas há diferença nas definições de tipo
|
||||
// entre a versão do Convex usada pelo projeto e a usada pelo @convex-dev/better-auth
|
||||
return ctx as unknown as GenericCtx<DataModel>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alterar senha do usuário autenticado
|
||||
@@ -19,7 +31,7 @@ export const alterarSenha = mutation({
|
||||
handler: async (ctx, args) => {
|
||||
try {
|
||||
// Verificar se o usuário está autenticado
|
||||
const authUser = await authComponent.safeGetAuthUser(ctx);
|
||||
const authUser = await authComponent.safeGetAuthUser(toGenericCtx(ctx));
|
||||
if (!authUser) {
|
||||
return {
|
||||
sucesso: false as const,
|
||||
|
||||
Reference in New Issue
Block a user