Skip to content

Commit

Permalink
Update src from PHP Codesniffer
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Aug 6, 2024
1 parent 240923b commit aa981c7
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 63 deletions.
10 changes: 5 additions & 5 deletions src/store/modules/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
)
},
Expand Down
10 changes: 5 additions & 5 deletions src/store/modules/configuration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down
12 changes: 6 additions & 6 deletions src/store/modules/configuration.specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand All @@ -38,7 +38,7 @@ describe(

it(
'sets configuration list correctly', () => {
const store = useConfigurationStore()
const store = useConfigurationStore()

store.setConfigurationItem(testData)

Expand Down
14 changes: 7 additions & 7 deletions src/store/modules/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
)
Expand Down
16 changes: 8 additions & 8 deletions src/store/modules/metadata.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand All @@ -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]
Expand All @@ -44,7 +44,7 @@ describe(

it(
'sets metadata list correctly', () => {
const store = useMetadataStore()
const store = useMetadataStore()

store.setMetaDataList(mockMetadata())

Expand All @@ -57,7 +57,7 @@ describe(

it(
'get metadata property from key', () => {
const store = useMetadataStore()
const store = useMetadataStore()

store.setMetaDataItem(mockMetadata()[0])
store.setMetadataDataKey('test')
Expand Down
10 changes: 5 additions & 5 deletions src/store/modules/organisation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
)
},
Expand Down
12 changes: 6 additions & 6 deletions src/store/modules/organisation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand All @@ -38,7 +38,7 @@ describe(

it(
'sets organisation list correctly', () => {
const store = useOrganisationStore()
const store = useOrganisationStore()

store.setOrganisationList(mockOrganisation())

Expand Down
20 changes: 10 additions & 10 deletions src/store/modules/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
)
Expand Down
10 changes: 5 additions & 5 deletions src/store/modules/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
)
},
Expand Down
12 changes: 6 additions & 6 deletions src/store/modules/theme.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand All @@ -38,7 +38,7 @@ describe(

it(
'sets theme list correctly', () => {
const store = useThemeStore()
const store = useThemeStore()

store.setThemeList(mockTheme())

Expand Down

0 comments on commit aa981c7

Please sign in to comment.