Skip to content

Commit

Permalink
store/cockpitApi: blueprint links
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kingsleyzissou committed Jan 13, 2025
1 parent f137b16 commit b2a2619
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/store/cockpitApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

0 comments on commit b2a2619

Please sign in to comment.