fix(manage): HandleReorderUI gibt 400 bei Mismatch zurück

This commit is contained in:
Jesko Anschütz 2026-03-26 22:27:07 +01:00
parent 1c11aa9877
commit 4fab5fe28a

View file

@ -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 {
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)