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:
@@ -132,7 +132,7 @@ export default async function MyOrdersPage() {
|
||||
Details ansehen
|
||||
</Button>
|
||||
</Link>
|
||||
{o.status === 'pending' && (
|
||||
{o.status !== 'completed' && (
|
||||
<Link href={`/order?id=${o.id}`}>
|
||||
<Button variant="outline" size="sm" className="border-amber-500/20 hover:bg-amber-500/10 hover:border-amber-500/40 text-amber-400 text-xs">
|
||||
Bearbeiten
|
||||
|
||||
@@ -66,7 +66,7 @@ async function OrderDataWrapper({ orderId }: { orderId?: string }) {
|
||||
redirect('/order')
|
||||
}
|
||||
|
||||
if (orderData.status !== 'pending' && !isAdmin) {
|
||||
if (orderData.status === 'completed' && !isAdmin) {
|
||||
redirect('/order')
|
||||
}
|
||||
|
||||
|
||||
@@ -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