mirror of
https://github.com/gabehf/Koito.git
synced 2026-04-22 12:01:52 -07:00
feat: add endpoint and ui to update mbz id
This commit is contained in:
parent
9bc3ef0c93
commit
d581f78732
2 changed files with 4 additions and 3 deletions
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue