fix(manage): HandleReorderUI gibt 400 bei Mismatch zurück
This commit is contained in:
parent
1c11aa9877
commit
4fab5fe28a
1 changed files with 6 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ package manage
|
|||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"html/template"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
|
|
@ -741,7 +742,11 @@ func HandleReorderUI(playlists *store.PlaylistStore, screens *store.ScreenStore,
|
|||
return
|
||||
}
|
||||
if err := playlists.Reorder(r.Context(), playlist.ID, ids); err != nil {
|
||||
http.Error(w, "db error", http.StatusInternalServerError)
|
||||
if errors.Is(err, store.ErrReorderMismatch) {
|
||||
http.Error(w, "item list mismatch", http.StatusBadRequest)
|
||||
} else {
|
||||
http.Error(w, "db error", http.StatusInternalServerError)
|
||||
}
|
||||
return
|
||||
}
|
||||
notifier.NotifyChanged(screenSlug)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue