mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-08 23:18:15 -07:00
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:
parent
7cf7cd3a10
commit
97cd378535
5 changed files with 177 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue