fix(estimates): allow approved estimate revocation

This commit is contained in:
Schubert Ferenc 2026-07-05 12:26:45 +02:00
parent 31bdc1047d
commit 8d37eb29b3
14 changed files with 295 additions and 8 deletions

View file

@ -0,0 +1,19 @@
import { NextRequest } from "next/server";
import { proxyHermesRequest } from "@/lib/server/hermes-proxy";
import { assertSameOrigin } from "@/lib/server/request-guards";
type Params = {
params: Promise<{ id: string; estimateId: string }>;
};
export async function POST(request: NextRequest, { params }: Params) {
const originError = assertSameOrigin(request);
if (originError) {
return originError;
}
const { id, estimateId } = await params;
return proxyHermesRequest(request, `/repairs/${id}/estimates/${estimateId}/revoke`);
}