From 11107c04ed90bbb156cf25d461ae84b635991bb0 Mon Sep 17 00:00:00 2001 From: Sergo Date: Sun, 30 Jul 2023 11:15:41 +0300 Subject: [PATCH] allow the remove method --- src/services/aliases/aliases.class.ts | 7 +++++-- src/services/aliases/aliases.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/services/aliases/aliases.class.ts b/src/services/aliases/aliases.class.ts index e64ab35..af938e3 100644 --- a/src/services/aliases/aliases.class.ts +++ b/src/services/aliases/aliases.class.ts @@ -47,7 +47,7 @@ export interface AliasesParams extends Params { export class AliasesService implements ServiceInterface { - constructor(public options: AliasesServiceOptions) { } + constructor(public options: AliasesServiceOptions) {} async find(params: ServiceParams): Promise { const userId = await this.getUserIdByEmailAddress(params); @@ -117,7 +117,10 @@ export class AliasesService const allowedDomain: string = config.get("wildDuck.domain"); // If address does not match the allowed domain, throw an error - if (!allowedDomain || !addressInfoResponse.address.endsWith(allowedDomain)) { + if ( + !allowedDomain || + !addressInfoResponse.address.endsWith(allowedDomain) + ) { throw new BadRequest("Unable to delete address"); } diff --git a/src/services/aliases/aliases.ts b/src/services/aliases/aliases.ts index 0a6ed37..97ba226 100644 --- a/src/services/aliases/aliases.ts +++ b/src/services/aliases/aliases.ts @@ -3,7 +3,7 @@ import { validateAuth } from "../../hooks/validate-auth"; import { AliasesService, getOptions } from "./aliases.class"; export const aliasesPath = "aliases"; -export const aliasesMethods = ["find", "create"] as const; +export const aliasesMethods = ["find", "create", "remove"] as const; export * from "./aliases.class";