adj: prevent deleting non-managed addresses
This commit is contained in:
		| @@ -125,9 +125,12 @@ export class AliasesService<ServiceParams extends AliasesParams = AliasesParams> | ||||
|     } | ||||
|  | ||||
|     sanitizeAliasResponse(alias: WildDuckAddress): AliasApiResponse { | ||||
|         // Prevent the user from deleting their main address or any address that does not end with the preferred domain | ||||
|         const isRemovable = !alias.main && alias.address.endsWith(config.get('wildDuck.domain')); | ||||
|  | ||||
|         // Hide the id if the alias is not removable | ||||
|         return { | ||||
|             id: alias.main ? null : alias.id, | ||||
|             id: isRemovable ? alias.id : null, | ||||
|             address: alias.address, | ||||
|             tags: alias.tags, | ||||
|             created: alias.created, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user