diff --git a/frontend/src/components/ItemModal.vue b/frontend/src/components/ItemModal.vue index 247294c..a1e406a 100644 --- a/frontend/src/components/ItemModal.vue +++ b/frontend/src/components/ItemModal.vue @@ -24,9 +24,17 @@ watch(() => props.item, (item) => { }, { immediate: true }) function stagesForType() { - return type.value === 'donation' ? DONATION_STAGES : OTHER_STAGES + if (type.value === 'donation') return DONATION_STAGES + if (type.value === 'other') return OTHER_STAGES + return ['new'] } +watch(type, () => { + if (!stagesForType().includes(stage.value)) { + stage.value = 'new' + } +}) + async function save() { const updated = await updateItem(props.item.id, { sender_id: senderId.value || null,