feat: add endpoint and ui to update mbz id (#125)

* wip

* wip

* feat: add endpoint and ui to update mbz id
This commit is contained in:
Gabe Farrell 2026-01-11 01:50:27 -05:00 committed by GitHub
parent 7cf7cd3a10
commit 97cd378535
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 177 additions and 1 deletions

View file

@ -270,6 +270,19 @@ function setPrimaryAlias(
body: form,
});
}
function updateMbzId(
type: string,
id: number,
mbzid: string
): Promise<Response> {
const form = new URLSearchParams();
form.append(`${type}_id`, String(id));
form.append("mbz_id", mbzid);
return fetch(`/apis/web/v1/mbzid`, {
method: "PATCH",
body: form,
});
}
function getAlbum(id: number): Promise<Album> {
return fetch(`/apis/web/v1/album?id=${id}`).then(
(r) => r.json() as Promise<Album>
@ -318,6 +331,7 @@ export {
createAlias,
deleteAlias,
setPrimaryAlias,
updateMbzId,
getApiKeys,
createApiKey,
deleteApiKey,