feat: add endpoint and ui to update mbz id

This commit is contained in:
Gabe Farrell 2026-01-11 01:46:22 -05:00
parent 9bc3ef0c93
commit d581f78732
2 changed files with 4 additions and 3 deletions

View file

@ -23,6 +23,7 @@ export default function UpdateMbzID({ type, id }: Props) {
setLoading(true);
updateMbzId(type, id, input).then((r) => {
if (r.ok) {
setSuccess("successfully updated MusicBrainz ID");
} else {
r.json().then((r) => setError(r.error));
}
@ -44,9 +45,9 @@ export default function UpdateMbzID({ type, id }: Props) {
<AsyncButton loading={loading} onClick={handleUpdateMbzID}>
Submit
</AsyncButton>
</div>
{err && <p className="error">{err}</p>}
{success && <p className="success">{success}</p>}
</div>
</div>
);
}

View file

@ -94,7 +94,7 @@ func bindRoutes(
r.Post("/aliases", handlers.CreateAliasHandler(db))
r.Post("/aliases/delete", handlers.DeleteAliasHandler(db))
r.Post("/aliases/primary", handlers.SetPrimaryAliasHandler(db))
r.Patch("/mbzid", handlers.UpdateAlbumHandler(db))
r.Patch("/mbzid", handlers.UpdateMbzIdHandler(db))
r.Get("/user/apikeys", handlers.GetApiKeysHandler(db))
r.Post("/user/apikeys", handlers.GenerateApiKeyHandler(db))
r.Patch("/user/apikeys", handlers.UpdateApiKeyLabelHandler(db))