Pocty zaznamu a vetsi stranky z Service Layeru

- GET /api/entities/{set}/$count a /api/<resource>/$count: pocet zaznamu
  jednim volanim SAPu, podporuje $filter, vraci { count }
- $inlinecount=allpages (alias $count=true) se predava do Service Layeru
- /all posila Prefer: odata.maxpagesize podle SAP_B1_PAGE_SIZE (vychozi 500)
  misto vychozich 20 zaznamu na stranku
- Swagger, README, .env.example, dokumentace a testy
This commit is contained in:
JiriUhlir
2026-12-03 12:48:11 +01:00
parent 6924459aac
commit f7b127c94a
10 changed files with 196 additions and 8 deletions
+4
View File
@@ -20,6 +20,10 @@ describe("OData helpers", () => {
});
});
it("passes $inlinecount through to Service Layer", () => {
expect(buildODataParams({ top: 1, inlinecount: "allpages" })).toEqual({ $top: 1, $inlinecount: "allpages" });
});
it("supports old and new nextLink field names", () => {
expect(extractNextLink({ "@odata.nextLink": "Items?$skip=20" })).toBe("Items?$skip=20");
expect(extractNextLink({ "odata.nextLink": "Items?$skip=40" })).toBe("Items?$skip=40");