feat: custom email message

This commit is contained in:
Elias Schneider
2022-12-15 21:44:04 +01:00
parent bfb47ba6e8
commit 0616a68bd2
6 changed files with 43 additions and 10 deletions

View File

@@ -23,7 +23,8 @@ export class ConfigService {
if (configVariable.type == "number") return parseInt(configVariable.value);
if (configVariable.type == "boolean") return configVariable.value == "true";
if (configVariable.type == "string") return configVariable.value;
if (configVariable.type == "string" || configVariable.type == "text")
return configVariable.value;
}
async listForAdmin() {
@@ -46,10 +47,15 @@ export class ConfigService {
if (!configVariable || configVariable.locked)
throw new NotFoundException("Config variable not found");
if (typeof value != configVariable.type)
if (
typeof value != configVariable.type &&
typeof value == "string" &&
configVariable.type != "text"
) {
throw new BadRequestException(
`Config variable must be of type ${configVariable.type}`
);
}
const updatedVariable = await this.prisma.config.update({
where: { key },