Skip to content

Commit b921a8f

Browse files
fix(reuses): ensure types and topics dropdowns are reactive
1 parent 61ee864 commit b921a8f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

components/Reuses/DescribeReuse.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
:placeholder="$t('Rechercher un type…')"
234234
:get-option-id="(type) => type.label"
235235
:display-value="(type) => type.label"
236-
:options="types ?? []"
236+
:options="typesOptions"
237237
:multiple="false"
238238
:required="true"
239239
:error-text="getFirstError('type')"
@@ -258,7 +258,7 @@
258258
:placeholder="$t('Rechercher une thématique…')"
259259
:get-option-id="(topic) => topic.label"
260260
:display-value="(topic) => topic.label"
261-
:options="topics ?? []"
261+
:options="topicsOptions"
262262
:multiple="false"
263263
:required="true"
264264
:error-text="getFirstError('topic')"
@@ -434,6 +434,9 @@ const addImageAccordionId = useId()
434434
const { data: types } = await useAPI<Array<ReuseType>>('/api/1/reuses/types', { lazy: true })
435435
const { data: topics } = await useAPI<Array<ReuseTopic>>('/api/1/reuses/topics', { lazy: true })
436436
437+
const typesOptions = computed(() => types.value ?? [])
438+
const topicsOptions = computed(() => topics.value ?? [])
439+
437440
const ownedOptions = computed<Array<Owned>>(() => {
438441
return [...user.value.organizations.map(organization => ({ organization, owner: null })), { owner: { ...user.value, class: 'User' }, organization: null }]
439442
})

0 commit comments

Comments
 (0)