feat: allow quote editing for all statuses except completed
All checks were successful
Staging Build / build (push) Successful in 3m35s
All checks were successful
Staging Build / build (push) Successful in 3m35s
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user