feat: allow quote editing for all statuses except completed
All checks were successful
Staging Build / build (push) Successful in 3m35s

This commit is contained in:
DanielS
2026-07-03 00:30:25 +02:00
parent 2bfadb49c8
commit 78a16607f9
4 changed files with 5 additions and 5 deletions

View File

@@ -418,8 +418,8 @@ export async function updateOrder(
throw new Error('Keine Berechtigung dieses Angebot zu bearbeiten.')
}
if (existingOrder.status !== 'pending' && !isAdmin) {
throw new Error('Nur Angebote im Status "Eingegangen" können bearbeitet werden.')
if (existingOrder.status === 'completed' && !isAdmin) {
throw new Error('Abgeschlossene Angebote können nicht mehr bearbeitet werden.')
}
// Fetch catalog directly from DB to prevent client tampering

View File

@@ -148,7 +148,7 @@ export type Order = {
order_data: OrderSnapshot
total_price: number
pdf_url: string | null
status: 'pending' | 'active' | 'cancelled'
status: 'pending' | 'active' | 'completed' | 'cancelled'
created_at: string
}