diff --git a/src/store/modules/zaakTypen.spec.ts b/src/store/modules/zaakTypen.spec.ts index 437c21a..1533ba8 100644 --- a/src/store/modules/zaakTypen.spec.ts +++ b/src/store/modules/zaakTypen.spec.ts @@ -25,7 +25,7 @@ describe('ZaakTypen Store', () => { store.setZaakTypeList(mockZaakType()) - expect(store.zaakTypenList).toHaveLength(mockZaakType().length) + expect(store.zaakTypeList).toHaveLength(mockZaakType().length) store.zaakTypenList.forEach((item, index) => { expect(item).toBeInstanceOf(ZaakType) diff --git a/src/store/modules/zaakTypen.ts b/src/store/modules/zaakTypen.ts index 7c2604c..018d011 100644 --- a/src/store/modules/zaakTypen.ts +++ b/src/store/modules/zaakTypen.ts @@ -13,7 +13,7 @@ type TOptions = { export const useZaakTypeStore = defineStore('zaakTypen', { state: () => ({ zaakTypeItem: null, - zaakTypenList: [], + zaakTypeList: [], }), actions: { setZaakTypeItem(zaakTypeItem: ZaakType | TZaakType) { @@ -33,7 +33,7 @@ export const useZaakTypeStore = defineStore('zaakTypen', { * @throws If the HTTP request fails. * @return {Promise<{ response: Response, data: TZaakType[], entities: ZaakType[] }>} The response, raw data, and entities. */ - async refreshZaakTypenList(search: string = null): Promise<{ response: Response, data: TZaakType[], entities: ZaakType[] }> { + async refreshZaakTypeList(search: string = null): Promise<{ response: Response, data: TZaakType[], entities: ZaakType[] }> { let endpoint = apiEndpoint if (search !== null && search !== '') { @@ -119,7 +119,7 @@ export const useZaakTypeStore = defineStore('zaakTypen', { throw new Error(`HTTP error! status: ${response.status}`) } - this.refreshZaakTypenList() + this.refreshZaakTypeList() return { response } }, @@ -168,7 +168,7 @@ export const useZaakTypeStore = defineStore('zaakTypen', { const entity = new ZaakType(data) options.setItem && this.setZaakTypeItem(data) - this.refreshZaakTypenList() + this.refreshZaakTypeList() return { response, data, entity } }, diff --git a/src/store/modules/zaken.ts b/src/store/modules/zaken.ts index ba32417..95e3abc 100644 --- a/src/store/modules/zaken.ts +++ b/src/store/modules/zaken.ts @@ -7,7 +7,7 @@ type TOptions = { /** * Save the zaak item to the store in 'zaakItem' */ - setZaakItem?: boolean + setItem?: boolean } export const useZaakStore = defineStore('zaken', { @@ -86,7 +86,7 @@ export const useZaakStore = defineStore('zaken', { const data = await response.json() const entity = new Zaak(data) - options.setZaakItem && this.setZaakItem(data) + options.setItem && this.setZaakItem(data) return { response, data, entity } }, @@ -134,7 +134,7 @@ export const useZaakStore = defineStore('zaken', { */ async saveZaak( zaakItem: Zaak | TZaak, - options: TOptions = { setZaakItem: true }, + options: TOptions = { setItem: true }, ): Promise<{ response: Response, data: TZaak, entity: Zaak }> { if (!zaakItem) { throw new Error('No zaak item to save') @@ -167,7 +167,7 @@ export const useZaakStore = defineStore('zaken', { const data = await response.json() as TZaak const entity = new Zaak(data) - options.setZaakItem && this.setZaakItem(data) + options.setItem && this.setZaakItem(data) this.refreshZakenList() return { response, data, entity } diff --git a/src/views/zaakTypen/ZaakTypenList.vue b/src/views/zaakTypen/ZaakTypenList.vue index 3428626..36a52f4 100644 --- a/src/views/zaakTypen/ZaakTypenList.vue +++ b/src/views/zaakTypen/ZaakTypenList.vue @@ -25,7 +25,7 @@ import { navigationStore, zaakTypeStore } from '../../store/store.js' -