add send none state to newsletter config

This commit is contained in:
Julian Krauser 2025-04-19 09:42:11 +02:00
parent 63f206cc6a
commit f1395357c5
6 changed files with 21 additions and 23 deletions

View file

@ -1,5 +1,5 @@
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
import { NewsletterConfigType } from "../../enums/newsletterConfigType";
import { NewsletterConfigEnum } from "../../enums/newsletterConfigEnum";
import { communicationType } from "./communicationType";
@Entity()
@ -11,15 +11,15 @@ export class newsletterConfig {
type: "varchar",
length: "255",
transformer: {
to(value: NewsletterConfigType) {
to(value: NewsletterConfigEnum) {
return value.toString();
},
from(value: string) {
return NewsletterConfigType[value as keyof typeof NewsletterConfigType];
return NewsletterConfigEnum[value as keyof typeof NewsletterConfigEnum];
},
},
})
config: NewsletterConfigType;
config: NewsletterConfigEnum;
@ManyToOne(() => communicationType, {
nullable: false,