mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Allow administrators to invalidate validated invoices
Update Avoirs.tsx to permit administrators to change the status of validated invoices, while preventing other roles from doing so. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869/yiEpJFx
This commit is contained in:
1 parent
c60fdac0ae
commit
5eca5adaec
1 file changed
+2
-2
@@ -460,8 +460,8 @@ export default function Avoirs() {
|
||||
const handleStatusChange = (avoirId: number, newStatus: string) => {
|
||||
const avoir = avoirs?.find(a => a?.id === avoirId);
|
||||
|
||||
// Empêcher la modification du statut pour les avoirs validés
|
||||
if (avoir?.nocodbVerified) {
|
||||
// Empêcher la modification du statut pour les avoirs validés, SAUF pour les administrateurs
|
||||
if (avoir?.nocodbVerified && (user as any)?.role !== 'admin') {
|
||||
toast({
|
||||
title: "Modification interdite",
|
||||
description: "Impossible de modifier le statut d'un avoir validé",
|
||||
|
||||
Reference in new issue
Block a user