that's all the API create routes! + some admin UI

Signed-off-by: ari melody <ari@arimelody.me>
This commit is contained in:
ari melody 2024-08-03 15:02:01 +01:00
parent 9329aa9f60
commit 494b29def3
11 changed files with 193 additions and 19 deletions

View file

@ -104,16 +104,16 @@ func CreateArtist() http.Handler {
}
if data.ID == "" {
http.Error(w, "Artist ID cannot be blank", http.StatusBadRequest)
http.Error(w, "Artist ID cannot be blank\n", http.StatusBadRequest)
return
}
if data.Name == "" {
http.Error(w, "Artist name cannot be blank", http.StatusBadRequest)
http.Error(w, "Artist name cannot be blank\n", http.StatusBadRequest)
return
}
if global.GetArtist(data.ID) != nil {
http.Error(w, fmt.Sprintf("Artist %s already exists", data.ID), http.StatusBadRequest)
http.Error(w, fmt.Sprintf("Artist %s already exists\n", data.ID), http.StatusBadRequest)
return
}