mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-05-09 19:01:47 +00:00
feat: endurece mutações financeiras e permite zerar conta
This commit is contained in:
@@ -65,7 +65,7 @@ async function assertAccountOwnership(userId: string, accountId: string) {
|
||||
});
|
||||
|
||||
if (!account) {
|
||||
throw new Error("FinancialAccount vinculada não encontrada.");
|
||||
throw new Error("Conta vinculada não encontrada.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ export async function createCardAction(
|
||||
userId: user.id,
|
||||
});
|
||||
|
||||
revalidateForEntity("cards");
|
||||
revalidateForEntity("cards", user.id);
|
||||
|
||||
return { success: true, message: "Cartão criado com sucesso." };
|
||||
} catch (error) {
|
||||
@@ -135,7 +135,7 @@ export async function updateCardAction(
|
||||
};
|
||||
}
|
||||
|
||||
revalidateForEntity("cards");
|
||||
revalidateForEntity("cards", user.id);
|
||||
|
||||
return { success: true, message: "Cartão atualizado com sucesso." };
|
||||
} catch (error) {
|
||||
@@ -162,7 +162,7 @@ export async function deleteCardAction(
|
||||
};
|
||||
}
|
||||
|
||||
revalidateForEntity("cards");
|
||||
revalidateForEntity("cards", user.id);
|
||||
|
||||
return { success: true, message: "Cartão removido com sucesso." };
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user