diff --git a/store/configurations.ts b/store/configurations.ts index e17a72dc1031743a48d10fbabaac074b229471d3..39d5a073a8399e314a82d43cf76e34371cce9ebd 100644 --- a/store/configurations.ts +++ b/store/configurations.ts @@ -78,7 +78,7 @@ export interface configurationsState { pageSize: number } -const state = { +const state = () => ({ configurations: [], configuration: null, configurationContacts: [], @@ -87,7 +87,7 @@ const state = { totalPages: 1, pageNumber: 1, pageSize: 20 -} +}) const getters = { projectNames: (state: configurationsState) => { @@ -170,7 +170,7 @@ const getters = { return result }, locationActionsDates: (state: configurationsState) => { - let result = [] + let result: IActionDateWithTextItem[] = [] if (state.configuration) { const datesWithTexts = [] diff --git a/store/contacts.ts b/store/contacts.ts index c7bd1e1b83b9a2e861b1443c5db4011694ca63cd..697771653c24770187c2c677d561b0dc81d9b71c 100644 --- a/store/contacts.ts +++ b/store/contacts.ts @@ -39,21 +39,21 @@ import { Api } from '@/services/Api' interface contactsState { contacts: Contact[], - contact: Contact|null, + contact: Contact | null, configurationContacts: Contact[], pageNumber: number, pageSize: number, totalPages: number } -export const state = { +export const state = () => ({ contacts: [], contact: null, configurationContacts: [], totalPages: 1, pageNumber: 1, pageSize: 20 -} +}) export const getters = { searchContacts: (state: contactsState) => { return state.contacts.filter((c: Contact) => !state.configurationContacts.find((rc: Contact) => rc.id === c.id)) diff --git a/store/devices.ts b/store/devices.ts index c007e3dc54cdeae8f3641846c128aa149bd88a81..c453ca8f556478b32db451e476deb9ccf7f0adf2 100644 --- a/store/devices.ts +++ b/store/devices.ts @@ -87,7 +87,7 @@ interface devicesState { totalPages: number } -const state = { +const state = () => ({ devices: [], device: null, deviceContacts: [], @@ -109,7 +109,7 @@ const state = { pageNumber: 1, pageSize: 20, totalPages: 1 -} +}) const getters = { actions: (state: devicesState) => { // Todo actions sortieren, wobei ehrlich gesagt, eine extra route im Backend mit allen Actions (sortiert) besser wäre diff --git a/store/files.ts b/store/files.ts index ebbbde8cdcecd5110da9ca85b18fec0a866ee594..02e759d710fc2756fd76bc2e212e332f7c0d3baa 100644 --- a/store/files.ts +++ b/store/files.ts @@ -33,7 +33,7 @@ import { Commit } from 'vuex' import { IUploadResult } from '@/services/sms/UploadApi' import { Api } from '@/services/Api' -const state = {} +const state = () => ({}) const getters = {} diff --git a/store/platforms.ts b/store/platforms.ts index 245666394ea5d1fbc7a0739b318f46727b3f7704..1f1b065b979415e6f4962a3db39f9f81e77c2022 100644 --- a/store/platforms.ts +++ b/store/platforms.ts @@ -72,7 +72,7 @@ interface platformsState { totalPages: number } -const state = { +const state = () => ({ platforms: [], platform: null, platformContacts: [], @@ -88,7 +88,7 @@ const state = { totalPages: 1, pageNumber: 1, pageSize: 20 -} +}) const getters = { actions: (state: platformsState) => { diff --git a/store/vocabulary.ts b/store/vocabulary.ts index 376fba84bb4688fa5993d6afd63d72415a8ec5a1..dfe6db843b146b8f2b59d2238bab9ae0cfc83adc 100644 --- a/store/vocabulary.ts +++ b/store/vocabulary.ts @@ -63,7 +63,7 @@ interface vocabularyState { measuredQuantityUnits: MeasuredQuantityUnit[] } -const state = { +const state = () => ({ manufacturers: [], equipmentstatus: [], devicetypes: [], @@ -75,7 +75,7 @@ const state = { properties: [], units: [], measuredQuantityUnits: [] -} +}) const getters = { getPlatformTypeByUri: (state: vocabularyState) => (uri: string): PlatformType | undefined => {