Merge branch 'master' into dev

This commit is contained in:
Sergo 2023-08-04 08:42:37 +03:00
commit 331425bdc4
3 changed files with 4 additions and 7 deletions

View File

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

View File

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

View File

@ -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";