This commit is contained in:
Moritz Utcke
2025-04-07 21:41:27 -04:00
parent 71438a39eb
commit 1970a105a9

View File

@@ -19,7 +19,7 @@ export const POST = defineApiRoute({
// Wir holen uns die Transaktion von Mollie.
const payment = await mollieClient.payments.get(id);
const metadata = payment.metadata as { rechnung_uid: string }
const metadata = payment.metadata as { rechnung_id: string }
if (!payment) {
throw new APIError({
@@ -28,7 +28,7 @@ export const POST = defineApiRoute({
});
}
if (!metadata.rechnung_uid) {
if (!metadata.rechnung_id) {
throw new APIError({
code: "BAD_REQUEST",
message: "Rechnung UID nicht gefunden.",
@@ -38,7 +38,7 @@ export const POST = defineApiRoute({
// Wir holen uns die Rechnung aus unserer Datenbank.
const rechnung = await prisma.rechnung.findUnique({
where: {
uid: metadata.rechnung_uid,
id: metadata.rechnung_id,
},
});