store/cockpitApi: blueprint links

Use the filename/id of the blueprints as the links to
the first and last element for the blueprint list metadata.
These links are a little meaningless since they should be
urls.
This commit is contained in:
Gianluca Zuccarelli 2025-01-13 09:16:52 +00:00 committed by Lucas Garfield
parent 6bc791a379
commit ad239b9b6c

View file

@ -92,13 +92,22 @@ export const cockpitApi = emptyCockpitApi.injectEndpoints({
return true;
});
let first = '';
let last = '';
if (blueprints.length > 0) {
first = blueprints[0].id;
last = blueprints[blueprints.length - 1].id;
}
return {
data: {
meta: { count: blueprints.length },
links: {
// TODO: figure out the pagination
first: '',
last: '',
// These are kind of meaningless for the on-prem
// version
first: first,
last: last,
},
data: blueprints,
},