Skip to content

Commit

Permalink
fixed selected catalogus and added disabled state on loading
Browse files Browse the repository at this point in the history
  • Loading branch information
RalkeyOfficial committed Aug 9, 2024
1 parent 120f8d3 commit 40a153d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/modals/catalog/AddCatalogModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ import { catalogiStore, navigationStore } from '../../store/store.js'
<NcSelect v-bind="organisations"
v-model="organisations.value"
input-label="Organisatie"
:loading="organisationsLoading" />
:loading="organisationsLoading"
:disabled="loading" />
</div>
<NcButton v-if="success === null"
:disabled="!catalogi.title || loading"
Expand Down
7 changes: 4 additions & 3 deletions src/modals/catalog/EditCatalogModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ import { catalogiStore, navigationStore } from '../../store/store.js'
<NcSelect v-bind="organisations"
v-model="organisations.value"
input-label="Organisatie"
:loading="organisationsLoading" />
:loading="organisationsLoading"
:disabled="loading" />
</div>
<NcButton v-if="success === null"
:disabled="loading"
Expand Down Expand Up @@ -141,14 +142,14 @@ export default {
})
.then((response) => {
response.json().then((data) => {
const selectedOrganisation = data.results.filter((org) => org?.id === catalogiStore.catalogiItem?.organisation?.id) || null
const selectedOrganisation = data.results.filter((org) => org?.id.toString() === catalogiStore.catalogiItem?.organisation.toString())[0] || null
this.organisations = {
options: data.results.map((organisation) => ({
id: organisation.id,
label: organisation.title,
})),
value: selectedOrganisation[0]
value: selectedOrganisation
? {
id: selectedOrganisation?.id,
label: selectedOrganisation?.title,
Expand Down

0 comments on commit 40a153d

Please sign in to comment.