diff --git a/frontend/components/Location/CreateModal.vue b/frontend/components/Location/CreateModal.vue index b87e2ef74..b9b93b0a4 100644 --- a/frontend/components/Location/CreateModal.vue +++ b/frontend/components/Location/CreateModal.vue @@ -138,7 +138,7 @@ import { Label } from "@/components/ui/label"; import { Input } from "@/components/ui/input"; import BaseModal from "@/components/App/CreateModal.vue"; - import type { EntityTypeSummary, EntitySummary } from "~~/lib/api/types/data-contracts"; + import type { EntitySummary } from "~~/lib/api/types/data-contracts"; import { AttachmentTypes } from "~~/lib/api/types/non-generated"; import { useDialog, useDialogHotkey } from "~/components/ui/dialog-provider"; import { useTagStore } from "~/stores/tags"; diff --git a/frontend/components/Tag/CreateModal.vue b/frontend/components/Tag/CreateModal.vue index 8b77a1271..95e64301e 100644 --- a/frontend/components/Tag/CreateModal.vue +++ b/frontend/components/Tag/CreateModal.vue @@ -115,6 +115,7 @@ } toast.success(t("components.tag.create_modal.toast.create_success")); + await tagStore.refresh(); reset(); if (close) { diff --git a/frontend/components/Tag/Selector.vue b/frontend/components/Tag/Selector.vue index 0f09455ed..882f20a8c 100644 --- a/frontend/components/Tag/Selector.vue +++ b/frontend/components/Tag/Selector.vue @@ -94,12 +94,14 @@ } from "@/components/ui/tags-input"; import type { TagOut } from "~/lib/api/types/data-contracts"; import { Label } from "@/components/ui/label"; + import { useTagStore } from "~/stores/tags"; const { t } = useI18n(); const id = useId(); const api = useUserApi(); + const tagStore = useTagStore(); const emit = defineEmits(["update:modelValue"]); const props = defineProps({ @@ -185,6 +187,10 @@ toast.success(t("components.tag.create_modal.toast.create_success")); + // Without this the parent's `props.tags` array doesn't contain the new tag, so + // `display-value` falls through to "Loading..." and the chip is stuck. + await tagStore.refresh(); + modelValue.value = [...modelValue.value, data.id]; }; diff --git a/frontend/lib/api/classes/items.ts b/frontend/lib/api/classes/items.ts index 64fa3f308..0b9b0c3f5 100644 --- a/frontend/lib/api/classes/items.ts +++ b/frontend/lib/api/classes/items.ts @@ -203,7 +203,7 @@ export class ItemsApi extends BaseAPI { return { ...resp, data: resp.data?.items ?? [], - } as { data: EntitySummary[]; error: any; status: number }; + }; } getTree(tq: TreeQuery = { withItems: false }) { diff --git a/frontend/pages/collection/index/entity-types.vue b/frontend/pages/collection/index/entity-types.vue index 920fdf53f..fec5a4fdc 100644 --- a/frontend/pages/collection/index/entity-types.vue +++ b/frontend/pages/collection/index/entity-types.vue @@ -1,5 +1,4 @@