allow the remove method
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				ci/woodpecker/push/woodpecker Pipeline was successful
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	ci/woodpecker/push/woodpecker Pipeline was successful
				
			This commit is contained in:
		| @@ -47,7 +47,7 @@ export interface AliasesParams extends Params<AliasesQuery> { | ||||
| export class AliasesService<ServiceParams extends AliasesParams = AliasesParams> | ||||
|   implements ServiceInterface<Alias, AliasesData, ServiceParams, AliasesPatch> | ||||
| { | ||||
|   constructor(public options: AliasesServiceOptions) { } | ||||
|   constructor(public options: AliasesServiceOptions) {} | ||||
|  | ||||
|   async find(params: ServiceParams): Promise<Alias[]> { | ||||
|     const userId = await this.getUserIdByEmailAddress(params); | ||||
| @@ -117,7 +117,10 @@ export class AliasesService<ServiceParams extends AliasesParams = AliasesParams> | ||||
|     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"); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -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"; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user