#6-messages #24
7 changed files with 8 additions and 28 deletions
|
@ -8,9 +8,7 @@ export interface UpdateTemplateCommand {
|
||||||
template: string;
|
template: string;
|
||||||
description: string | null;
|
description: string | null;
|
||||||
design: object;
|
design: object;
|
||||||
headerHTML: string;
|
html: string;
|
||||||
bodyHTML: string;
|
|
||||||
footerHTML: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeleteTemplateCommand {
|
export interface DeleteTemplateCommand {
|
||||||
|
|
|
@ -40,9 +40,7 @@ export default abstract class TemplateCommandHandler {
|
||||||
template: updateTemplate.template,
|
template: updateTemplate.template,
|
||||||
description: updateTemplate.description,
|
description: updateTemplate.description,
|
||||||
design: updateTemplate.design,
|
design: updateTemplate.design,
|
||||||
headerHTML: updateTemplate.headerHTML,
|
html: updateTemplate.html,
|
||||||
bodyHTML: updateTemplate.bodyHTML,
|
|
||||||
footerHTML: updateTemplate.footerHTML,
|
|
||||||
})
|
})
|
||||||
.where("id = :id", { id: updateTemplate.id })
|
.where("id = :id", { id: updateTemplate.id })
|
||||||
.execute()
|
.execute()
|
||||||
|
|
|
@ -59,18 +59,14 @@ export async function updateTemplate(req: Request, res: Response): Promise<any>
|
||||||
const template = req.body.template;
|
const template = req.body.template;
|
||||||
const description = req.body.description;
|
const description = req.body.description;
|
||||||
const design = req.body.design;
|
const design = req.body.design;
|
||||||
const headerHTML = req.body.headerHTML;
|
const html = req.body.html;
|
||||||
const bodyHTML = req.body.bodyHTML;
|
|
||||||
const footerHTML = req.body.footerHTML;
|
|
||||||
|
|
||||||
let updateTemplate: UpdateTemplateCommand = {
|
let updateTemplate: UpdateTemplateCommand = {
|
||||||
id: id,
|
id: id,
|
||||||
template: template,
|
template: template,
|
||||||
description: description,
|
description: description,
|
||||||
design: design,
|
design: design,
|
||||||
headerHTML: headerHTML,
|
html: html,
|
||||||
bodyHTML: bodyHTML,
|
|
||||||
footerHTML: footerHTML,
|
|
||||||
};
|
};
|
||||||
await TemplateCommandHandler.update(updateTemplate);
|
await TemplateCommandHandler.update(updateTemplate);
|
||||||
|
|
||||||
|
|
|
@ -26,11 +26,5 @@ export class template {
|
||||||
design: object;
|
design: object;
|
||||||
|
|
||||||
@Column({ type: "text", default: "" })
|
@Column({ type: "text", default: "" })
|
||||||
headerHTML: string;
|
html: string;
|
||||||
|
|
||||||
@Column({ type: "text", default: "" })
|
|
||||||
bodyHTML: string;
|
|
||||||
|
|
||||||
@Column({ type: "text", default: "" })
|
|
||||||
footerHTML: string;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,9 +13,7 @@ export default abstract class TemplateFactory {
|
||||||
template: record.template,
|
template: record.template,
|
||||||
description: record.description,
|
description: record.description,
|
||||||
design: record.design,
|
design: record.design,
|
||||||
headerHTML: record.headerHTML,
|
html: record.html,
|
||||||
bodyHTML: record.bodyHTML,
|
|
||||||
footerHTML: record.footerHTML,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,9 +15,7 @@ export class Template1734854680201 implements MigrationInterface {
|
||||||
{ name: "template", type: "varchar", length: "255", isNullable: false },
|
{ name: "template", type: "varchar", length: "255", isNullable: false },
|
||||||
{ name: "description", type: "varchar", length: "255", isNullable: true },
|
{ name: "description", type: "varchar", length: "255", isNullable: true },
|
||||||
{ name: "design", type: "text", isNullable: false, default: "'{}'" },
|
{ name: "design", type: "text", isNullable: false, default: "'{}'" },
|
||||||
{ name: "headerHTML", type: "text", isNullable: false, default: "''" },
|
{ name: "html", type: "text", isNullable: false, default: "''" },
|
||||||
{ name: "bodyHTML", type: "text", isNullable: false, default: "''" },
|
|
||||||
{ name: "footerHTML", type: "text", isNullable: false, default: "''" },
|
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
true
|
true
|
||||||
|
|
|
@ -3,7 +3,5 @@ export interface TemplateViewModel {
|
||||||
template: string;
|
template: string;
|
||||||
description: string | null;
|
description: string | null;
|
||||||
design: object;
|
design: object;
|
||||||
headerHTML: string;
|
html: string;
|
||||||
bodyHTML: string;
|
|
||||||
footerHTML: string;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue