small adjustments #1

Merged
lauri merged 3 commits from dev into master 2023-08-04 05:54:15 +00:00
2 changed files with 26 additions and 6 deletions
Showing only changes of commit 331425bdc4 - Show all commits

View File

@@ -45,10 +45,8 @@ function renderAliases(aliases) {
} }
}) })
aDelete.classList.add('btn') aDelete.classList.add('btn', 'btn-danger')
aDelete.classList.add('btn-danger')
aDelete.innerText = 'Delete' aDelete.innerText = 'Delete'
aDelete.setAttribute('href', `/aliases/${alias.id}`)
tdActions.appendChild(aDelete) tdActions.appendChild(aDelete)
tr.appendChild(tdAddress) tr.appendChild(tdAddress)

View File

@@ -123,11 +123,10 @@ export class AliasesService<ServiceParams extends AliasesParams = AliasesParams>
) { ) {
throw new BadRequest("Unable to delete address"); throw new BadRequest("Unable to delete address");
} }
await wildDuckClient.delete<Alias>(`/addresses/${id}`);
const userId = await this.getUserIdByEmailAddress(params); const userId = await this.getUserIdByEmailAddress(params);
await wildDuckClient.delete<Alias>(`users/${userId}/addresses/${id}`);
return this.getUserAddresses(userId); return this.getUserAddresses(userId);
} }
} }

View File

@@ -3,7 +3,7 @@ import { validateAuth } from "../../hooks/validate-auth";
import { AliasesService, getOptions } from "./aliases.class"; import { AliasesService, getOptions } from "./aliases.class";
export const aliasesPath = "aliases"; export const aliasesPath = "aliases";
export const aliasesMethods = ["find", "create"] as const; export const aliasesMethods = ["find", "create", "remove"] as const;
export * from "./aliases.class"; export * from "./aliases.class";