diff --git a/src/services/aliases/aliases.class.ts b/src/services/aliases/aliases.class.ts index af938e3..0f91d6c 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); @@ -123,11 +123,10 @@ export class AliasesService ) { throw new BadRequest("Unable to delete address"); } - - await wildDuckClient.delete(`/addresses/${id}`); - const userId = await this.getUserIdByEmailAddress(params); + await wildDuckClient.delete(`users/${userId}/addresses/${id}`); + return this.getUserAddresses(userId); } }