From 33b582ce20e26ff403035f07626a3d5156608402 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Mon, 9 Mar 2026 17:02:59 +0800 Subject: [PATCH] remove sharing labels v1 api --- next-ui/src/colada/referential.ts | 16 +--------------- .../components/user/form/CreateEdit.stories.ts | 10 ++++++++++ next-ui/src/components/user/form/CreateEdit.vue | 12 ++++++++---- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/next-ui/src/colada/referential.ts b/next-ui/src/colada/referential.ts index 05691360..bce61b6c 100644 --- a/next-ui/src/colada/referential.ts +++ b/next-ui/src/colada/referential.ts @@ -1,21 +1,7 @@ -import { defineQuery, defineQueryOptions, useQuery } from '@pinia/colada' +import { defineQueryOptions } from '@pinia/colada' import { komgaClient } from '@/api/komga-client' import type { PageRequest } from '@/types/PageRequest' -export const useSharingLabels = defineQuery(() => { - return useQuery({ - key: () => ['sharing-labels'], - query: () => - komgaClient - .GET('/api/v1/sharing-labels') - // unwrap the openapi-fetch structure on success - .then((res) => res.data), - // 1 hour - staleTime: 60 * 60 * 1000, - gcTime: false, - }) -}) - export const authorsQuery = defineQueryOptions( ({ search, diff --git a/next-ui/src/components/user/form/CreateEdit.stories.ts b/next-ui/src/components/user/form/CreateEdit.stories.ts index c85fad1b..103005e0 100644 --- a/next-ui/src/components/user/form/CreateEdit.stories.ts +++ b/next-ui/src/components/user/form/CreateEdit.stories.ts @@ -2,6 +2,9 @@ import type { Meta, StoryObj } from '@storybook/vue3-vite' import CreateEdit from './CreateEdit.vue' import { UserRoles } from '@/types/UserRoles' +import { httpTyped } from '@/mocks/api/httpTyped' +import { mockPage } from '@/mocks/api/pageable' +import { PageRequest } from '@/types/PageRequest' const meta = { component: CreateEdit, @@ -19,6 +22,13 @@ const meta = { component: '', }, }, + msw: { + handlers: [ + httpTyped.get('/api/v2/sharing-labels', ({ response }) => + response(200).json(mockPage(['kids', 'teens'], PageRequest.Unpaged())), + ), + ], + }, }, args: {}, } satisfies Meta diff --git a/next-ui/src/components/user/form/CreateEdit.vue b/next-ui/src/components/user/form/CreateEdit.vue index 4d8daba2..ca489583 100644 --- a/next-ui/src/components/user/form/CreateEdit.vue +++ b/next-ui/src/components/user/form/CreateEdit.vue @@ -211,7 +211,7 @@ closable-chips multiple hide-details - :items="sharingLabels" + :items="sharingLabels?.content" >