refactor: update to receipt only instead of set
This commit is contained in:
parent
ce51b8cc0f
commit
aecf52fdc9
2 changed files with 57 additions and 32 deletions
|
|
@ -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) },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue