Search API: use a single query with result and count

This commit is contained in:
2026-01-23 14:45:25 +01:00
parent 8689082741
commit 601e583575
9 changed files with 94 additions and 144 deletions

View File

@@ -11,7 +11,7 @@ func TestCallInventaireSearch_NoParameters(t *testing.T) {
if err != nil {
t.Error(err)
}
assert.Equal(t, 17, result.Total)
assert.Equal(t, int64(17), result.Total)
assert.Equal(t, 10, len(result.Results))
}
@@ -20,7 +20,7 @@ func TestCallInventaireSearch_NoLimit(t *testing.T) {
if err != nil {
t.Error(err)
}
assert.Equal(t, 17, result.Total)
assert.Equal(t, int64(17), result.Total)
assert.Equal(t, 10, len(result.Results))
}
@@ -29,7 +29,7 @@ func TestCallInventaireSearch_Limit(t *testing.T) {
if err != nil {
t.Error(err)
}
assert.Equal(t, 17, result.Total)
assert.Equal(t, int64(17), result.Total)
assert.Equal(t, 5, len(result.Results))
}
@@ -38,7 +38,7 @@ func TestCallInventaireSearch_Offset(t *testing.T) {
if err != nil {
t.Error(err)
}
assert.Equal(t, 17, result.Total)
assert.Equal(t, int64(17), result.Total)
assert.Equal(t, 2, len(result.Results))
}