diff --git a/src/store/modules/configuration.js b/src/store/modules/configuration.js index a1cb0449..d4561a4b 100644 --- a/src/store/modules/configuration.js +++ b/src/store/modules/configuration.js @@ -27,16 +27,16 @@ export const useConfigurationStore = defineStore( ) .then( (response) => { - response.json().then( - (data) => { - this.setConfigurationItem(data) + response.json().then( + (data) => { + this.setConfigurationItem(data) } - ) + ) } ) .catch( (err) => { - console.error(err) + console.error(err) } ) }, diff --git a/src/store/modules/configuration.spec.js b/src/store/modules/configuration.spec.js index 674586b6..814184e0 100644 --- a/src/store/modules/configuration.spec.js +++ b/src/store/modules/configuration.spec.js @@ -5,15 +5,15 @@ import { useConfigurationStore } from './configuration.js' describe( 'Configuration Store', () => { - beforeEach( - () => { - setActivePinia(createPinia()) + beforeEach( + () => { + setActivePinia(createPinia()) } - ) + ) it( 'sets configuration item correctly', () => { - const store = useConfigurationStore() + const store = useConfigurationStore() store.setConfigurationItem(mockConfiguration()[0]) diff --git a/src/store/modules/configuration.specs.js b/src/store/modules/configuration.specs.js index aeb143d3..62920f59 100644 --- a/src/store/modules/configuration.specs.js +++ b/src/store/modules/configuration.specs.js @@ -6,15 +6,15 @@ import { useConfigurationStore } from './configuration.js'; describe( 'Metadata Store', () => { - beforeEach( - () => { - setActivePinia(createPinia()) + beforeEach( + () => { + setActivePinia(createPinia()) } - ) + ) it( 'sets configuration item correctly', () => { - const store = useConfigurationStore() + const store = useConfigurationStore() store.setConfigurationItem(testData[0]) @@ -38,7 +38,7 @@ describe( it( 'sets configuration list correctly', () => { - const store = useConfigurationStore() + const store = useConfigurationStore() store.setConfigurationItem(testData) diff --git a/src/store/modules/metadata.js b/src/store/modules/metadata.js index cb8c0ffd..0de1c28e 100644 --- a/src/store/modules/metadata.js +++ b/src/store/modules/metadata.js @@ -41,19 +41,19 @@ export const useMetadataStore = defineStore( ) .then( (response) => { - response.json().then( - (data) => { - this.metaDataList = data.results.map( - (metadataItem) => new Metadata(metadataItem), - ) + response.json().then( + (data) => { + this.metaDataList = data.results.map( + (metadataItem) => new Metadata(metadataItem), + ) return data } - ) + ) } ) .catch( (err) => { - console.error(err) + console.error(err) return err } ) diff --git a/src/store/modules/metadata.spec.js b/src/store/modules/metadata.spec.js index 514b5062..38b1a8ab 100644 --- a/src/store/modules/metadata.spec.js +++ b/src/store/modules/metadata.spec.js @@ -6,15 +6,15 @@ import { Metadata, mockMetadata } from '../../entities/index.js' describe( 'Metadata Store', () => { - beforeEach( - () => { - setActivePinia(createPinia()) + beforeEach( + () => { + setActivePinia(createPinia()) } - ) + ) it( 'sets metadata item correctly', () => { - const store = useMetadataStore() + const store = useMetadataStore() store.setMetaDataItem(mockMetadata()[0]) @@ -27,7 +27,7 @@ describe( it( 'sets metadata item with string "properties" property', () => { - const store = useMetadataStore() + const store = useMetadataStore() // stringify json data const mockData = mockMetadata()[0] @@ -44,7 +44,7 @@ describe( it( 'sets metadata list correctly', () => { - const store = useMetadataStore() + const store = useMetadataStore() store.setMetaDataList(mockMetadata()) @@ -57,7 +57,7 @@ describe( it( 'get metadata property from key', () => { - const store = useMetadataStore() + const store = useMetadataStore() store.setMetaDataItem(mockMetadata()[0]) store.setMetadataDataKey('test') diff --git a/src/store/modules/organisation.js b/src/store/modules/organisation.js index 61b952b7..3844677c 100644 --- a/src/store/modules/organisation.js +++ b/src/store/modules/organisation.js @@ -33,16 +33,16 @@ export const useOrganisationStore = defineStore( ) .then( (response) => { - response.json().then( - (data) => { - this.setOrganisationList(data.results) + response.json().then( + (data) => { + this.setOrganisationList(data.results) } - ) + ) } ) .catch( (err) => { - console.error(err) + console.error(err) } ) }, diff --git a/src/store/modules/organisation.spec.js b/src/store/modules/organisation.spec.js index 27385c8e..b14a260b 100644 --- a/src/store/modules/organisation.spec.js +++ b/src/store/modules/organisation.spec.js @@ -6,15 +6,15 @@ import { useOrganisationStore } from './organisation.js'; describe( 'Organisation Store', () => { - beforeEach( - () => { - setActivePinia(createPinia()) + beforeEach( + () => { + setActivePinia(createPinia()) } - ) + ) it( 'sets organisation item correctly', () => { - const store = useOrganisationStore() + const store = useOrganisationStore() store.setOrganisationItem(mockOrganisation()[0]) @@ -38,7 +38,7 @@ describe( it( 'sets organisation list correctly', () => { - const store = useOrganisationStore() + const store = useOrganisationStore() store.setOrganisationList(mockOrganisation()) diff --git a/src/store/modules/search.js b/src/store/modules/search.js index db326f1e..cd1a532b 100644 --- a/src/store/modules/search.js +++ b/src/store/modules/search.js @@ -27,22 +27,22 @@ export const useSearchStore = defineStore( ) .then( (response) => { - response.json().then( - (data) => { - if (data?.code === 403 && data?.message) { - this.searchError = data.message - console.log(this.searchError) - } else { - this.searchError = '' // Clear any previous errors - } + response.json().then( + (data) => { + if (data?.code === 403 && data?.message) { + this.searchError = data.message + console.log(this.searchError) + } else { + this.searchError = '' // Clear any previous errors + } this.searchResults = data } - ) + ) } ) .catch( (err) => { - this.searchError = err.message || 'An error occurred' + this.searchError = err.message || 'An error occurred' console.error(err.message ?? err) } ) diff --git a/src/store/modules/theme.js b/src/store/modules/theme.js index e7fe9bd1..0cecf1b0 100644 --- a/src/store/modules/theme.js +++ b/src/store/modules/theme.js @@ -33,16 +33,16 @@ export const useThemeStore = defineStore( ) .then( (response) => { - response.json().then( - (data) => { - this.setThemeList(data.results) + response.json().then( + (data) => { + this.setThemeList(data.results) } - ) + ) } ) .catch( (err) => { - console.error(err) + console.error(err) } ) }, diff --git a/src/store/modules/theme.spec.js b/src/store/modules/theme.spec.js index 34931d81..cb7b85cc 100644 --- a/src/store/modules/theme.spec.js +++ b/src/store/modules/theme.spec.js @@ -6,15 +6,15 @@ import { mockTheme, Theme } from '../../entities/index.js' describe( 'Theme Store', () => { - beforeEach( - () => { - setActivePinia(createPinia()) + beforeEach( + () => { + setActivePinia(createPinia()) } - ) + ) it( 'sets theme item correctly', () => { - const store = useThemeStore() + const store = useThemeStore() store.setThemeItem(mockTheme()[0]) @@ -38,7 +38,7 @@ describe( it( 'sets theme list correctly', () => { - const store = useThemeStore() + const store = useThemeStore() store.setThemeList(mockTheme())