API: Update endpoints to return HTTP 201 when a new resource was created

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-10-20 16:46:59 +02:00
parent ddc37e08ab
commit ce304abd2c
12 changed files with 194 additions and 30 deletions

View File

@@ -97,7 +97,7 @@ func TestBatchAlbumsDelete(t *testing.T) {
app, router, _ := NewApiTest()
CreateAlbum(router)
r := PerformRequestWithBody(app, "POST", "/api/v1/albums", `{"Title": "BatchDelete", "Description": "To be deleted", "Notes": "", "Favorite": true}`)
assert.Equal(t, http.StatusOK, r.Code)
assert.Equal(t, http.StatusCreated, r.Code)
uid := gjson.Get(r.Body.String(), "UID").String()
t.Run("Success", func(t *testing.T) {