Changelog - 2026-09-06
List headers from an offset and a total
New FeatureIn one line. A route whose engine reports offset and total instead of a TDataRange can now call setListHeaders directly, with no hand-formatted Content-Range.
What changed
BaseRestController.setListHeaders()takes{ context, count }plus either{ range }or{ offset, total }. The second form derives the inclusive range withbuildDataRange.toContentRange({ range, count })is now exported from@venizia/ignis-kernel.- An empty page still writes
records */<total>. respond()is unchanged. Use it when the body is the{ count, data }envelope.
typescript
this.setListHeaders({ context, offset, total, count: hits.length });
return context.json({ found, isFoundExact, hits });Who is affected
- Routes that write
Content-Rangethemselves. Replace the formatting withsetListHeaders({ context, offset, total, count }), ortoContentRangewhen only the string is needed. - Everyone else. No action needed.
Details
- Reference: Controllers.