diff --git a/src/components/smart/OeActorWidget.vue b/src/components/smart/OeActorWidget.vue index 9605238f..23cf7744 100644 --- a/src/components/smart/OeActorWidget.vue +++ b/src/components/smart/OeActorWidget.vue @@ -1,24 +1,38 @@ - - + + + Sluiten - + + - + diff --git a/src/components/smart/OeActorWidgetGrid.vue b/src/components/smart/OeActorWidgetGrid.vue index c7ab217e..57b1c12c 100644 --- a/src/components/smart/OeActorWidgetGrid.vue +++ b/src/components/smart/OeActorWidgetGrid.vue @@ -1,25 +1,54 @@ - + + + {{ rowCountText }} + Vernieuwen + + + + + + + - + diff --git a/src/services/actor.service.ts b/src/services/actor.service.ts index e33ccc65..0c8e3ba3 100644 --- a/src/services/actor.service.ts +++ b/src/services/actor.service.ts @@ -1,5 +1,6 @@ import { HttpService } from './http.service'; import type { IActor } from '@models/actor'; +import type { IResponse } from '@models/grid'; export class ActorService extends HttpService { readonly API_URL: string; @@ -24,4 +25,23 @@ export class ActorService extends HttpService { }) ).data; } + + async getDossiers(rangeStart: number, rangeEnd: number, query: any): Promise> { + const contentRange = `items=${rangeStart}-${rangeEnd}`; + const { data, headers } = await this.get(`${this.API_URL}/actoren`, { + headers: { + Range: contentRange, + Accept: 'application/json', + Authorization: 'Bearer ' + (await this.getSsoToken()), + }, + params: query, + }); + + const resCR = headers['content-range']; + let lastRow = 0; + if (resCR) { + lastRow = resCR.substr(resCR.indexOf('/') + 1); + } + return { content: data, lastRow }; + } } diff --git a/src/stories/smart-components/oe-actor-widget.stories.ts b/src/stories/smart-components/oe-actor-widget.stories.ts index f3325a02..5307c7d9 100644 --- a/src/stories/smart-components/oe-actor-widget.stories.ts +++ b/src/stories/smart-components/oe-actor-widget.stories.ts @@ -24,8 +24,14 @@ export const Default: Story = { components: { OeActorWidget, }, + setup() { + const id = '1'; + const api = 'https://dev-actoren.onroerenderfgoed.be'; + const getSsoToken = async () => 1; + return { id, api, getSsoToken }; + }, template: ` - + `, }), };