refactor: update to receipt only instead of set

This commit is contained in:
Methapon2001 2024-12-24 10:11:11 +07:00
parent ce51b8cc0f
commit aecf52fdc9
2 changed files with 57 additions and 32 deletions

View file

@ -331,6 +331,14 @@ export class FlowAccountController extends Controller {
const result = await flowAccount.issueInvoice(payment.invoice.id);
const documentId = result?.body?.data?.documentId;
if (!documentId) {
throw new HttpError(
HttpStatus.INTERNAL_SERVER_ERROR,
"FlowAccount error",
"flowAccountError",
);
}
await prisma.invoice.update({
where: { id: payment.invoice.id },
data: { flowAccountRecordId: String(documentId) },