template storing
This commit is contained in:
parent
98477eafde
commit
160d82459d
12 changed files with 386 additions and 1 deletions
36
src/entity/template.ts
Normal file
36
src/entity/template.ts
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { Column, Entity, PrimaryColumn } from "typeorm";
|
||||
|
||||
@Entity()
|
||||
export class template {
|
||||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
template: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
description?: string;
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
default: "{}",
|
||||
transformer: {
|
||||
to(value: object) {
|
||||
return JSON.stringify(value);
|
||||
},
|
||||
from(value: string) {
|
||||
return JSON.parse(value);
|
||||
},
|
||||
},
|
||||
})
|
||||
design: object;
|
||||
|
||||
@Column({ type: "text", default: "" })
|
||||
headerHTML: string;
|
||||
|
||||
@Column({ type: "text", default: "" })
|
||||
bodyHTML: string;
|
||||
|
||||
@Column({ type: "text", default: "" })
|
||||
footerHTML: string;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue