From b2a2619948fbeff3faff0e7cff0ae6337f379436 Mon Sep 17 00:00:00 2001 From: Gianluca Zuccarelli Date: Mon, 13 Jan 2025 09:16:52 +0000 Subject: [PATCH] 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. --- src/store/cockpitApi.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/store/cockpitApi.ts b/src/store/cockpitApi.ts index 97f5afcf2..3977d378f 100644 --- a/src/store/cockpitApi.ts +++ b/src/store/cockpitApi.ts @@ -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, },