mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
feat: hook up the invice customize api
This commit is contained in:
@@ -30,11 +30,14 @@ export class EditPdfTemplate {
|
||||
const { PdfTemplate } = this.tenancy.models(tenantId);
|
||||
|
||||
return this.uow.withTransaction(tenantId, async (trx) => {
|
||||
await PdfTemplate.query(trx)
|
||||
.patch({
|
||||
...editTemplateDTO,
|
||||
})
|
||||
.where('id', templateId);
|
||||
await this.eventPublisher.emitAsync(events.pdfTemplate.onEditing, {
|
||||
tenantId,
|
||||
templateId,
|
||||
});
|
||||
await PdfTemplate.query(trx).where('id', templateId).update({
|
||||
templateName: editTemplateDTO.templateName,
|
||||
attributes: editTemplateDTO.attributes,
|
||||
});
|
||||
|
||||
await this.eventPublisher.emitAsync(events.pdfTemplate.onEdited, {
|
||||
tenantId,
|
||||
|
||||
Reference in New Issue
Block a user