mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
API: Refactor /batch/photos/edit endpoint to return "models" #271
The "photos" array in the response has been renamed to "models". This data is now always returned, so using the "return" flag in the request is no longer necessary. Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -27,12 +27,12 @@ func TestBatchPhotosEdit(t *testing.T) {
|
||||
body := response.Body.String()
|
||||
|
||||
assert.NotEmpty(t, body)
|
||||
assert.True(t, strings.HasPrefix(body, `{"values":{"`), "unexpected response")
|
||||
assert.True(t, strings.HasPrefix(body, `{"models":[{"ID"`), "unexpected response")
|
||||
|
||||
// fmt.Println(body)
|
||||
/* photos := gjson.Get(body, "photos")
|
||||
/* models := gjson.Get(body, "models")
|
||||
values := gjson.Get(body, "values")
|
||||
t.Logf("photos: %#v", photos)
|
||||
t.Logf("models: %#v", models)
|
||||
t.Logf("values: %#v", values) */
|
||||
|
||||
assert.Equal(t, http.StatusOK, response.Code)
|
||||
@@ -52,12 +52,12 @@ func TestBatchPhotosEdit(t *testing.T) {
|
||||
body := response.Body.String()
|
||||
|
||||
assert.NotEmpty(t, body)
|
||||
assert.True(t, strings.HasPrefix(body, `{"photos":[{"ID"`), "unexpected response")
|
||||
assert.True(t, strings.HasPrefix(body, `{"models":[{"ID"`), "unexpected response")
|
||||
|
||||
fmt.Println(body)
|
||||
/* photos := gjson.Get(body, "photos")
|
||||
/* models := gjson.Get(body, "models")
|
||||
values := gjson.Get(body, "values")
|
||||
t.Logf("photos: %#v", photos)
|
||||
t.Logf("models: %#v", models)
|
||||
t.Logf("values: %#v", values) */
|
||||
|
||||
assert.Equal(t, http.StatusOK, response.Code)
|
||||
@@ -95,7 +95,7 @@ func TestBatchPhotosEdit(t *testing.T) {
|
||||
body := response.Body.String()
|
||||
|
||||
assert.NotEmpty(t, body)
|
||||
assert.True(t, strings.HasPrefix(body, `{"values":{"`), "unexpected response")
|
||||
assert.True(t, strings.HasPrefix(body, `{"models":[{"ID"`), "unexpected response")
|
||||
|
||||
assert.Equal(t, http.StatusOK, response.Code)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user