From 17f29ef3ca1cbc83cabd0131e598680490b1fcae Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Wed, 11 Mar 2026 11:28:18 +0800 Subject: [PATCH] bump pinia colada --- next-ui/package-lock.json | 49 ++++++++++--------- next-ui/package.json | 8 +-- next-ui/src/colada/books.ts | 5 +- next-ui/src/colada/collections.ts | 5 +- next-ui/src/colada/history.ts | 2 +- next-ui/src/colada/page-hashes.ts | 6 +-- next-ui/src/colada/readlists.ts | 5 +- next-ui/src/colada/referential.ts | 30 ------------ next-ui/src/colada/series.ts | 5 +- next-ui/src/colada/users.ts | 4 +- next-ui/src/components/RemoteFileList.vue | 2 +- .../src/components/dialog/SeriesPicker.vue | 28 +++++------ next-ui/src/components/filter/by/Author.vue | 13 ++--- next-ui/src/components/filter/by/Genre.vue | 13 ++--- .../src/components/filter/by/Publisher.vue | 13 ++--- .../src/components/filter/by/SharingLabel.vue | 13 ++--- next-ui/src/components/filter/by/Tag.vue | 13 ++--- .../src/components/history/HistoryTable.vue | 6 +-- .../import/books/TransientBooksTable.vue | 34 +++++++------ .../src/components/import/readlist/Table.vue | 16 +++--- .../components/library/LibraryNavigation.vue | 20 +++++--- .../src/components/pageHash/KnownTable.vue | 10 ++-- .../src/components/pageHash/MatchTable.vue | 10 ++-- .../src/components/pageHash/UnknownTable.vue | 8 +-- .../user/AuthenticationActivityTable.vue | 7 +-- .../src/components/user/form/CreateEdit.vue | 8 +-- next-ui/src/pages/import/books.vue | 8 +-- next-ui/src/pages/libraries/[id]/series.vue | 16 +++--- 28 files changed, 171 insertions(+), 186 deletions(-) diff --git a/next-ui/package-lock.json b/next-ui/package-lock.json index 932289fd..daee39f7 100644 --- a/next-ui/package-lock.json +++ b/next-ui/package-lock.json @@ -9,9 +9,9 @@ "version": "0.0.0", "dependencies": { "@formatjs/intl-localematcher": "^0.8.1", - "@pinia/colada": "^0.21.2", - "@pinia/colada-plugin-auto-refetch": "^0.2.4", - "@pinia/colada-plugin-delay": "^0.1.4", + "@pinia/colada": "^1.0.0", + "@pinia/colada-plugin-auto-refetch": "^0.2.6", + "@pinia/colada-plugin-delay": "^0.2.0", "@vueuse/components": "^14.2.1", "@vueuse/core": "^14.2.1", "@vueuse/router": "^14.2.1", @@ -32,7 +32,7 @@ "@eslint/js": "^9.39.2", "@formatjs/cli": "^6.13.0", "@iconify-json/mdi": "^1.2.3", - "@pinia/colada-devtools": "^0.4.2", + "@pinia/colada-devtools": "^0.4.5", "@storybook/addon-a11y": "^10.2.16", "@storybook/addon-docs": "^10.2.16", "@storybook/addon-themes": "^10.2.16", @@ -2391,9 +2391,9 @@ } }, "node_modules/@pinia/colada": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@pinia/colada/-/colada-0.21.2.tgz", - "integrity": "sha512-k2epk1jed5cTmNA7l00UtsFRyqw9HfyU6WO4cV0BMUT3sSE4CMLCilprbLAL5h2bxD76WSiglciI/6o+Uh7Vzw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@pinia/colada/-/colada-1.0.0.tgz", + "integrity": "sha512-YKSybA6wusFK4CAUPzItoSgPCfScVnnnO2MSlmaaisE/L7luE77GxFyhTzipM8IbvbXh4zkCy97OE7w9WX34wA==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/posva" @@ -2404,9 +2404,9 @@ } }, "node_modules/@pinia/colada-devtools": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@pinia/colada-devtools/-/colada-devtools-0.4.2.tgz", - "integrity": "sha512-BikO2+rfSNeUyKoHncWDQINEEiux3yN4/JbAoCjt6Tv32f7sG8aBFiHkXJ/xWa3kIxAP9Xgj/+CmTueTYzj7fA==", + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/@pinia/colada-devtools/-/colada-devtools-0.4.5.tgz", + "integrity": "sha512-YSUa5nVmtbcQG+to7qysixNcB49bxEMUo+VvkU9YFrUNFPhPVUl+tMx3Xx79J024MEV46nQkyf1+hpQ4kwSsyg==", "dev": true, "license": "MIT", "funding": { @@ -2414,24 +2414,27 @@ } }, "node_modules/@pinia/colada-plugin-auto-refetch": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@pinia/colada-plugin-auto-refetch/-/colada-plugin-auto-refetch-0.2.4.tgz", - "integrity": "sha512-+/XTIX+7gaRt6vXyqAyXDjujjVU+EyHM3851zdlD/qsoHjt9V5VgjOPnUWwtAwHjipd5jfkCoDN3uyVEsxiOqA==", - "license": "MIT", - "peerDependencies": { - "@pinia/colada": ">=0.17.7" - } - }, - "node_modules/@pinia/colada-plugin-delay": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@pinia/colada-plugin-delay/-/colada-plugin-delay-0.1.4.tgz", - "integrity": "sha512-FYpOj7IamiyWi42wx3o81IVIkUbmxUhmh4DVXD3hD53mJE3WJ5Gl+NC1XVcA8cTxISnOq3b/08Xda+qFPNgY/A==", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/@pinia/colada-plugin-auto-refetch/-/colada-plugin-auto-refetch-0.2.6.tgz", + "integrity": "sha512-u/W8orRnOEHKWqatQ1yaHr9R1UPKJseHKjShW23oqq4TrOZvR6RU8Nc7flBtTbauU2KCydpgDQE68tWAZ4sNsg==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/posva" }, "peerDependencies": { - "@pinia/colada": ">=0.19.1" + "@pinia/colada": ">=1.0.0" + } + }, + "node_modules/@pinia/colada-plugin-delay": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@pinia/colada-plugin-delay/-/colada-plugin-delay-0.2.0.tgz", + "integrity": "sha512-NrcvBGyVqMP/rajoDgM/Za603jKDxId+cLQRK05Xp0vvh4YI5EmiQ8gP17rsZ5RTJiagOyxQAfr2hIkHhHgLGQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "@pinia/colada": ">=1.0.0" } }, "node_modules/@pkgjs/parseargs": { diff --git a/next-ui/package.json b/next-ui/package.json index 67d520e0..40c77a4c 100644 --- a/next-ui/package.json +++ b/next-ui/package.json @@ -30,9 +30,9 @@ }, "dependencies": { "@formatjs/intl-localematcher": "^0.8.1", - "@pinia/colada": "^0.21.2", - "@pinia/colada-plugin-auto-refetch": "^0.2.4", - "@pinia/colada-plugin-delay": "^0.1.4", + "@pinia/colada": "^1.0.0", + "@pinia/colada-plugin-auto-refetch": "^0.2.6", + "@pinia/colada-plugin-delay": "^0.2.0", "@vueuse/components": "^14.2.1", "@vueuse/core": "^14.2.1", "@vueuse/router": "^14.2.1", @@ -53,7 +53,7 @@ "@eslint/js": "^9.39.2", "@formatjs/cli": "^6.13.0", "@iconify-json/mdi": "^1.2.3", - "@pinia/colada-devtools": "^0.4.2", + "@pinia/colada-devtools": "^0.4.5", "@storybook/addon-a11y": "^10.2.16", "@storybook/addon-docs": "^10.2.16", "@storybook/addon-themes": "^10.2.16", diff --git a/next-ui/src/colada/books.ts b/next-ui/src/colada/books.ts index 80c2a546..36e529ce 100644 --- a/next-ui/src/colada/books.ts +++ b/next-ui/src/colada/books.ts @@ -12,11 +12,9 @@ export const QUERY_KEYS_BOOKS = { export const bookListQuery = defineQueryOptions( ({ search, - pause = false, pageRequest, }: { search: components['schemas']['BookSearch'] - pause?: boolean pageRequest?: PageRequest }) => ({ key: QUERY_KEYS_BOOKS.bySearch({ search: search, pageRequest: pageRequest }), @@ -32,8 +30,7 @@ export const bookListQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - enabled: !pause, - placeholderData: (previousData: any) => previousData, // eslint-disable-line @typescript-eslint/no-explicit-any + placeholderData: (previousData) => previousData, }), ) diff --git a/next-ui/src/colada/collections.ts b/next-ui/src/colada/collections.ts index 75ae64d7..10a883f7 100644 --- a/next-ui/src/colada/collections.ts +++ b/next-ui/src/colada/collections.ts @@ -12,12 +12,10 @@ export const collectionsListQuery = defineQueryOptions( ({ search, libraryIds, - pause = false, pageRequest, }: { search?: string libraryIds?: string[] - pause?: boolean pageRequest?: PageRequest }) => ({ key: QUERY_KEYS_COLLECTIONS.bySearch({ search: search, libraryIds, pageRequest: pageRequest }), @@ -34,8 +32,7 @@ export const collectionsListQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - enabled: !pause, - placeholderData: (previousData: any) => previousData, // eslint-disable-line @typescript-eslint/no-explicit-any + placeholderData: (previousData) => previousData, }), ) diff --git a/next-ui/src/colada/history.ts b/next-ui/src/colada/history.ts index ed47502d..207b38d0 100644 --- a/next-ui/src/colada/history.ts +++ b/next-ui/src/colada/history.ts @@ -13,6 +13,6 @@ export const historyQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - placeholderData: (previousData: any) => previousData, // eslint-disable-line @typescript-eslint/no-explicit-any + placeholderData: (previousData) => previousData, }), ) diff --git a/next-ui/src/colada/page-hashes.ts b/next-ui/src/colada/page-hashes.ts index b2cd571e..a22c9332 100644 --- a/next-ui/src/colada/page-hashes.ts +++ b/next-ui/src/colada/page-hashes.ts @@ -33,7 +33,7 @@ export const pageHashesKnownQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - placeholderData: (previousData: any) => previousData, // eslint-disable-line @typescript-eslint/no-explicit-any + placeholderData: (previousData) => previousData, }), ) @@ -53,7 +53,7 @@ export const pageHashesUnknownQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - placeholderData: (previousData: any) => previousData, // eslint-disable-line @typescript-eslint/no-explicit-any + placeholderData: (previousData) => previousData, }), ) @@ -86,6 +86,6 @@ export const pageHashMatchesQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - placeholderData: (previousData: any) => previousData, // eslint-disable-line @typescript-eslint/no-explicit-any + placeholderData: (previousData) => previousData, }), ) diff --git a/next-ui/src/colada/readlists.ts b/next-ui/src/colada/readlists.ts index 26390b99..df986217 100644 --- a/next-ui/src/colada/readlists.ts +++ b/next-ui/src/colada/readlists.ts @@ -12,12 +12,10 @@ export const readListsListQuery = defineQueryOptions( ({ search, libraryIds, - pause = false, pageRequest, }: { search?: string libraryIds?: string[] - pause?: boolean pageRequest?: PageRequest }) => ({ key: QUERY_KEYS_READLIST.bySearch({ @@ -38,8 +36,7 @@ export const readListsListQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - enabled: !pause, - placeholderData: (previousData: any) => previousData, // eslint-disable-line @typescript-eslint/no-explicit-any + placeholderData: (previousData) => previousData, }), ) diff --git a/next-ui/src/colada/referential.ts b/next-ui/src/colada/referential.ts index bce61b6c..a6a463ac 100644 --- a/next-ui/src/colada/referential.ts +++ b/next-ui/src/colada/referential.ts @@ -11,8 +11,6 @@ export const authorsQuery = defineQueryOptions( series_id, readlist_id, pageRequest, - pause = false, - placeholder = true, }: { search?: string role?: string @@ -21,8 +19,6 @@ export const authorsQuery = defineQueryOptions( series_id?: string[] readlist_id?: string[] pageRequest?: PageRequest - pause?: boolean - placeholder?: boolean }) => { const queryParams = { search: search, @@ -44,8 +40,6 @@ export const authorsQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - enabled: !pause, - placeholderData: placeholder ? (previousData: any) => previousData : undefined, // eslint-disable-line @typescript-eslint/no-explicit-any } }, ) @@ -56,15 +50,11 @@ export const genresQuery = defineQueryOptions( library_id, collection_id, pageRequest, - pause = false, - placeholder = true, }: { search?: string library_id?: string[] collection_id?: string[] pageRequest?: PageRequest - pause?: boolean - placeholder?: boolean }) => { const queryParams = { search: search, @@ -83,8 +73,6 @@ export const genresQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - enabled: !pause, - placeholderData: placeholder ? (previousData: any) => previousData : undefined, // eslint-disable-line @typescript-eslint/no-explicit-any } }, ) @@ -98,8 +86,6 @@ export const tagsQuery = defineQueryOptions( readlist_id, include, pageRequest, - pause = false, - placeholder = true, }: { search?: string library_id?: string[] @@ -108,8 +94,6 @@ export const tagsQuery = defineQueryOptions( readlist_id?: string[] include?: 'SERIES' | 'BOOK' | 'BOTH' pageRequest?: PageRequest - pause?: boolean - placeholder?: boolean }) => { const queryParams = { search: search, @@ -131,8 +115,6 @@ export const tagsQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - enabled: !pause, - placeholderData: placeholder ? (previousData: any) => previousData : undefined, // eslint-disable-line @typescript-eslint/no-explicit-any } }, ) @@ -143,15 +125,11 @@ export const publishersQuery = defineQueryOptions( library_id, collection_id, pageRequest, - pause = false, - placeholder = true, }: { search?: string library_id?: string[] collection_id?: string[] pageRequest?: PageRequest - pause?: boolean - placeholder?: boolean }) => { const queryParams = { search: search, @@ -170,8 +148,6 @@ export const publishersQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - enabled: !pause, - placeholderData: placeholder ? (previousData: any) => previousData : undefined, // eslint-disable-line @typescript-eslint/no-explicit-any } }, ) @@ -182,15 +158,11 @@ export const sharingLabelsQuery = defineQueryOptions( library_id, collection_id, pageRequest, - pause = false, - placeholder = true, }: { search?: string library_id?: string[] collection_id?: string[] pageRequest?: PageRequest - pause?: boolean - placeholder?: boolean }) => { const queryParams = { search: search, @@ -209,8 +181,6 @@ export const sharingLabelsQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - enabled: !pause, - placeholderData: placeholder ? (previousData: any) => previousData : undefined, // eslint-disable-line @typescript-eslint/no-explicit-any } }, ) diff --git a/next-ui/src/colada/series.ts b/next-ui/src/colada/series.ts index eb297bf5..ab6d7ea6 100644 --- a/next-ui/src/colada/series.ts +++ b/next-ui/src/colada/series.ts @@ -13,11 +13,9 @@ export const QUERY_KEYS_SERIES = { export const seriesListQuery = defineQueryOptions( ({ search, - pause = false, pageRequest, }: { search: components['schemas']['SeriesSearch'] - pause?: boolean pageRequest?: PageRequest }) => ({ key: QUERY_KEYS_SERIES.bySearch({ search: search, pageRequest: pageRequest }), @@ -33,8 +31,7 @@ export const seriesListQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - enabled: !pause, - placeholderData: (previousData: any) => previousData, // eslint-disable-line @typescript-eslint/no-explicit-any + placeholderData: (previousData) => previousData, }), ) diff --git a/next-ui/src/colada/users.ts b/next-ui/src/colada/users.ts index 67a8cea1..557e109e 100644 --- a/next-ui/src/colada/users.ts +++ b/next-ui/src/colada/users.ts @@ -219,7 +219,7 @@ export const authenticationActivityQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - placeholderData: (previousData: any) => previousData, // eslint-disable-line @typescript-eslint/no-explicit-any + placeholderData: (previousData) => previousData, }), ) @@ -249,6 +249,6 @@ export const myAuthenticationActivityQuery = defineQueryOptions( }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - placeholderData: (previousData: any) => previousData, // eslint-disable-line @typescript-eslint/no-explicit-any + placeholderData: (previousData) => previousData, }), ) diff --git a/next-ui/src/components/RemoteFileList.vue b/next-ui/src/components/RemoteFileList.vue index 25fbc082..2cf90c27 100644 --- a/next-ui/src/components/RemoteFileList.vue +++ b/next-ui/src/components/RemoteFileList.vue @@ -74,6 +74,6 @@ const { }) // unwrap the openapi-fetch structure on success .then((res) => res.data), - placeholderData: (previousData: any) => previousData, // eslint-disable-line @typescript-eslint/no-explicit-any + placeholderData: (previousData) => previousData, }) diff --git a/next-ui/src/components/dialog/SeriesPicker.vue b/next-ui/src/components/dialog/SeriesPicker.vue index 7e815b17..8f143659 100644 --- a/next-ui/src/components/dialog/SeriesPicker.vue +++ b/next-ui/src/components/dialog/SeriesPicker.vue @@ -147,22 +147,20 @@ const { data: series, isLoading, error, -} = useQuery(seriesListQuery, () => { - const search: components['schemas']['SeriesSearch'] = { - fullTextSearch: searchStringDebounced.value, - ...(!includeOneShots && { - condition: { - oneShot: { operator: 'IsFalse' }, - }, - }), - } - - return { - search: search, - pause: !searchStringDebounced.value, +} = useQuery(() => ({ + ...seriesListQuery({ + search: { + fullTextSearch: searchStringDebounced.value, + ...(!includeOneShots && { + condition: { + oneShot: { operator: 'IsFalse' }, + }, + }), + }, pageRequest: PageRequest.Unpaged(), - } -}) + }), + enabled: !searchStringDebounced.value, +})) const { data: libraries } = useLibraries() diff --git a/next-ui/src/components/filter/by/Author.vue b/next-ui/src/components/filter/by/Author.vue index bd1c74be..34571a0d 100644 --- a/next-ui/src/components/filter/by/Author.vue +++ b/next-ui/src/components/filter/by/Author.vue @@ -44,12 +44,13 @@ const apiQuery = { role: role, } -const { data: searchItems, isLoading: searchLoading } = useQuery(authorsQuery, () => ({ - pageRequest: PageRequest.Unpaged(), - search: searchDebounced.value, - pause: !searchDebounced.value, - placeholder: false, - ...apiQuery, +const { data: searchItems, isLoading: searchLoading } = useQuery(() => ({ + ...authorsQuery({ + pageRequest: PageRequest.Unpaged(), + search: searchDebounced.value, + ...apiQuery, + }), + enabled: searchDebounced.value, })) const searchResults = computed(() => searchItems.value?.content?.map((it) => toItemType(it.name))) diff --git a/next-ui/src/components/filter/by/Genre.vue b/next-ui/src/components/filter/by/Genre.vue index 23d5b74e..93682187 100644 --- a/next-ui/src/components/filter/by/Genre.vue +++ b/next-ui/src/components/filter/by/Genre.vue @@ -39,12 +39,13 @@ const apiQuery = { ...filterContext, } -const { data: searchItems, isLoading: searchLoading } = useQuery(genresQuery, () => ({ - pageRequest: PageRequest.Unpaged(), - search: searchDebounced.value, - pause: !searchDebounced.value, - placeholder: false, - ...apiQuery, +const { data: searchItems, isLoading: searchLoading } = useQuery(() => ({ + ...genresQuery({ + pageRequest: PageRequest.Unpaged(), + search: searchDebounced.value, + ...apiQuery, + }), + enabled: searchDebounced.value, })) const searchResults = computed(() => searchItems.value?.content?.map((it) => toItemType(it))) diff --git a/next-ui/src/components/filter/by/Publisher.vue b/next-ui/src/components/filter/by/Publisher.vue index aa836dbd..8a254e7b 100644 --- a/next-ui/src/components/filter/by/Publisher.vue +++ b/next-ui/src/components/filter/by/Publisher.vue @@ -39,12 +39,13 @@ const apiQuery = { ...filterContext, } -const { data: searchItems, isLoading: searchLoading } = useQuery(publishersQuery, () => ({ - pageRequest: PageRequest.Unpaged(), - search: searchDebounced.value, - pause: !searchDebounced.value, - placeholder: false, - ...apiQuery, +const { data: searchItems, isLoading: searchLoading } = useQuery(() => ({ + ...publishersQuery({ + pageRequest: PageRequest.Unpaged(), + search: searchDebounced.value, + ...apiQuery, + }), + enabled: searchDebounced.value, })) const searchResults = computed(() => searchItems.value?.content?.map((it) => toItemType(it))) diff --git a/next-ui/src/components/filter/by/SharingLabel.vue b/next-ui/src/components/filter/by/SharingLabel.vue index a9c0a298..8c4d797c 100644 --- a/next-ui/src/components/filter/by/SharingLabel.vue +++ b/next-ui/src/components/filter/by/SharingLabel.vue @@ -39,12 +39,13 @@ const apiQuery = { ...filterContext, } -const { data: searchItems, isLoading: searchLoading } = useQuery(sharingLabelsQuery, () => ({ - pageRequest: PageRequest.Unpaged(), - search: searchDebounced.value, - pause: !searchDebounced.value, - placeholder: false, - ...apiQuery, +const { data: searchItems, isLoading: searchLoading } = useQuery(() => ({ + ...sharingLabelsQuery({ + pageRequest: PageRequest.Unpaged(), + search: searchDebounced.value, + ...apiQuery, + }), + enabled: searchDebounced.value, })) const searchResults = computed(() => searchItems.value?.content?.map((it) => toItemType(it))) diff --git a/next-ui/src/components/filter/by/Tag.vue b/next-ui/src/components/filter/by/Tag.vue index 75926a01..7fde62f6 100644 --- a/next-ui/src/components/filter/by/Tag.vue +++ b/next-ui/src/components/filter/by/Tag.vue @@ -44,12 +44,13 @@ const apiQuery = { include: include, } -const { data: searchItems, isLoading: searchLoading } = useQuery(tagsQuery, () => ({ - pageRequest: PageRequest.Unpaged(), - search: searchDebounced.value, - pause: !searchDebounced.value, - placeholder: false, - ...apiQuery, +const { data: searchItems, isLoading: searchLoading } = useQuery(() => ({ + ...tagsQuery({ + pageRequest: PageRequest.Unpaged(), + search: searchDebounced.value, + ...apiQuery, + }), + enabled: searchDebounced.value, })) const searchResults = computed(() => searchItems.value?.content?.map((it) => toItemType(it))) diff --git a/next-ui/src/components/history/HistoryTable.vue b/next-ui/src/components/history/HistoryTable.vue index 56bf7dbb..c62572ae 100644 --- a/next-ui/src/components/history/HistoryTable.vue +++ b/next-ui/src/components/history/HistoryTable.vue @@ -143,7 +143,7 @@ const headers = [ const pageRequest = ref(new PageRequest()) -const { data, isLoading, error } = useQuery(historyQuery, () => ({ ...pageRequest.value })) +const { data, isLoading, error } = useQuery(() => historyQuery({ ...pageRequest.value })) function updateOptions({ page, @@ -204,14 +204,14 @@ const seriesCache = reactive>({}) const booksCache = reactive>({}) const getSeriesTitle = useMemoize(async (seriesId: string) => - useQuery(seriesDetailQuery, () => ({ seriesId: seriesId })) + useQuery(() => seriesDetailQuery({ seriesId: seriesId })) .refresh(true) .then(({ data }) => data?.metadata.title) .catch(() => undefined), ) const getBookTitle = useMemoize(async (bookId: string) => - useQuery(bookDetailQuery, () => ({ bookId: bookId })) + useQuery(() => bookDetailQuery({ bookId: bookId })) .refresh(true) .then(({ data }) => data?.metadata.title) .catch(() => undefined), diff --git a/next-ui/src/components/import/books/TransientBooksTable.vue b/next-ui/src/components/import/books/TransientBooksTable.vue index bd9d2533..631e82fb 100644 --- a/next-ui/src/components/import/books/TransientBooksTable.vue +++ b/next-ui/src/components/import/books/TransientBooksTable.vue @@ -521,9 +521,11 @@ function fileNamePicked(name: string) { //endregion function analyzeBook(book: BookImport) { - void useQuery(transientBookAnalyze, () => ({ - transientBookId: book.transientBook.id, - })) + void useQuery(() => + transientBookAnalyze({ + transientBookId: book.transientBook.id, + }), + ) .refresh() .then(({ data }) => { if (data) { @@ -535,9 +537,11 @@ function analyzeBook(book: BookImport) { } function fetchSeries(book: BookImport) { - void useQuery(seriesDetailQuery, () => ({ - seriesId: book.transientBook.seriesId!, - })) + void useQuery(() => + seriesDetailQuery({ + seriesId: book.transientBook.seriesId!, + }), + ) .refresh() .then(({ data }) => { if (data) assignSeries(book, data) @@ -545,14 +549,16 @@ function fetchSeries(book: BookImport) { } function fetchBooks(book: BookImport) { - void useQuery(bookListQuery, () => ({ - search: { - condition: { - seriesId: { operator: 'Is', value: book.series!.id }, - }, - } as components['schemas']['BookSearch'], - pageRequest: PageRequest.Unpaged(), - })) + void useQuery(() => + bookListQuery({ + search: { + condition: { + seriesId: { operator: 'Is', value: book.series!.id }, + }, + } as components['schemas']['BookSearch'], + pageRequest: PageRequest.Unpaged(), + }), + ) .refresh() .then(({ data }) => { if (data) { diff --git a/next-ui/src/components/import/readlist/Table.vue b/next-ui/src/components/import/readlist/Table.vue index 710618e3..b94e7404 100644 --- a/next-ui/src/components/import/readlist/Table.vue +++ b/next-ui/src/components/import/readlist/Table.vue @@ -487,13 +487,15 @@ function bookPicked(book: components['schemas']['BookDto']) { //endregion const getSeriesBooks = useMemoize(async (seriesId: string) => - useQuery(bookListQuery, () => ({ - search: { - condition: { - seriesId: { operator: 'Is', value: seriesId }, - }, - } as components['schemas']['BookSearch'], - })) + useQuery(() => + bookListQuery({ + search: { + condition: { + seriesId: { operator: 'Is', value: seriesId }, + }, + } as components['schemas']['BookSearch'], + }), + ) .refresh() .then(({ data }) => data), ) diff --git a/next-ui/src/components/library/LibraryNavigation.vue b/next-ui/src/components/library/LibraryNavigation.vue index eb0f5fae..90f6376a 100644 --- a/next-ui/src/components/library/LibraryNavigation.vue +++ b/next-ui/src/components/library/LibraryNavigation.vue @@ -28,15 +28,19 @@ const { libraryId } = defineProps<{ const display = useDisplay() const { libraries } = useGetLibrariesById(libraryId) -const { data: collections } = useQuery(collectionsListQuery, () => ({ - libraryIds: libraries.value?.map((it) => it.id), - pageRequest: PageRequest.Zero(), - pause: libraries.value === undefined, +const { data: collections } = useQuery(() => ({ + ...collectionsListQuery({ + libraryIds: libraries.value?.map((it) => it.id), + pageRequest: PageRequest.Zero(), + }), + enabled: libraries.value !== undefined, })) -const { data: readlists } = useQuery(readListsListQuery, () => ({ - libraryIds: libraries.value?.map((it) => it.id), - pageRequest: PageRequest.Zero(), - pause: libraries.value === undefined, +const { data: readlists } = useQuery(() => ({ + ...readListsListQuery({ + libraryIds: libraries.value?.map((it) => it.id), + pageRequest: PageRequest.Zero(), + }), + enabled: libraries.value !== undefined, })) const routesBase = [ diff --git a/next-ui/src/components/pageHash/KnownTable.vue b/next-ui/src/components/pageHash/KnownTable.vue index d0f12a72..0bb9cb6f 100644 --- a/next-ui/src/components/pageHash/KnownTable.vue +++ b/next-ui/src/components/pageHash/KnownTable.vue @@ -331,10 +331,12 @@ const filterOptions = [ const pageRequest = ref(new PageRequest()) -const { data, isLoading, error } = useQuery(pageHashesKnownQuery, () => ({ - ...pageRequest.value, - actions: filterSelect.value, -})) +const { data, isLoading, error } = useQuery(() => + pageHashesKnownQuery({ + ...pageRequest.value, + actions: filterSelect.value, + }), +) function updateOptions({ page, diff --git a/next-ui/src/components/pageHash/MatchTable.vue b/next-ui/src/components/pageHash/MatchTable.vue index a770533f..9911ae5e 100644 --- a/next-ui/src/components/pageHash/MatchTable.vue +++ b/next-ui/src/components/pageHash/MatchTable.vue @@ -129,10 +129,12 @@ const headers = [ const sortBy = ref([]) const pageRequest = ref(new PageRequest()) -const { data, isLoading, error } = useQuery(pageHashMatchesQuery, () => ({ - pageHash: pageHash.value, - ...pageRequest.value, -})) +const { data, isLoading, error } = useQuery(() => + pageHashMatchesQuery({ + pageHash: pageHash.value, + ...pageRequest.value, + }), +) function updateOptions({ page, diff --git a/next-ui/src/components/pageHash/UnknownTable.vue b/next-ui/src/components/pageHash/UnknownTable.vue index 2ca06687..b4be0b35 100644 --- a/next-ui/src/components/pageHash/UnknownTable.vue +++ b/next-ui/src/components/pageHash/UnknownTable.vue @@ -278,9 +278,11 @@ const headers = [ const pageRequest = ref(new PageRequest()) -const { data, isLoading, error } = useQuery(pageHashesUnknownQuery, () => ({ - ...pageRequest.value, -})) +const { data, isLoading, error } = useQuery(() => + pageHashesUnknownQuery({ + ...pageRequest.value, + }), +) function updateOptions({ page, diff --git a/next-ui/src/components/user/AuthenticationActivityTable.vue b/next-ui/src/components/user/AuthenticationActivityTable.vue index 42ca66a8..2a3ea4ff 100644 --- a/next-ui/src/components/user/AuthenticationActivityTable.vue +++ b/next-ui/src/components/user/AuthenticationActivityTable.vue @@ -151,9 +151,10 @@ const headers = computed(() => { const pageRequest = ref(new PageRequest()) -const { data, isLoading, error } = useQuery( - forMe ? myAuthenticationActivityQuery : authenticationActivityQuery, - () => ({ ...pageRequest.value }), +const { data, isLoading, error } = useQuery(() => + forMe + ? myAuthenticationActivityQuery({ ...pageRequest.value }) + : authenticationActivityQuery({ ...pageRequest.value }), ) function updateOptions({ diff --git a/next-ui/src/components/user/form/CreateEdit.vue b/next-ui/src/components/user/form/CreateEdit.vue index ca489583..515bfcaa 100644 --- a/next-ui/src/components/user/form/CreateEdit.vue +++ b/next-ui/src/components/user/form/CreateEdit.vue @@ -280,9 +280,11 @@ const user = defineModel({ required: true }) const showPassword = ref(false) const { data: libraries } = useLibraries() -const { data: sharingLabels } = useQuery(sharingLabelsQuery, () => ({ - pageRequest: PageRequest.Unpaged(), -})) +const { data: sharingLabels } = useQuery(() => + sharingLabelsQuery({ + pageRequest: PageRequest.Unpaged(), + }), +) function selectAllLibraries() { user.value.sharedLibraries!.all = !user.value.sharedLibraries?.all diff --git a/next-ui/src/pages/import/books.vue b/next-ui/src/pages/import/books.vue index 612261c5..eceb052d 100644 --- a/next-ui/src/pages/import/books.vue +++ b/next-ui/src/pages/import/books.vue @@ -25,9 +25,11 @@ const { data: transientBooks, isLoading, refetch, -} = useQuery(transientBooksScan, () => ({ - path: scanDirectory.value, -})) +} = useQuery(() => + transientBooksScan({ + path: scanDirectory.value, + }), +) function doScan(directory: string) { scanDirectory.value = directory diff --git a/next-ui/src/pages/libraries/[id]/series.vue b/next-ui/src/pages/libraries/[id]/series.vue index 37e92213..06621420 100644 --- a/next-ui/src/pages/libraries/[id]/series.vue +++ b/next-ui/src/pages/libraries/[id]/series.vue @@ -295,16 +295,14 @@ const conds = computed(() => ({ ], })) -const { data: series } = useQuery(seriesListQuery, () => { - const search: components['schemas']['SeriesSearch'] = { - condition: conds.value as components['schemas']['AllOfSeries'], - } - - return { - search: search, +const { data: series } = useQuery(() => + seriesListQuery({ + search: { + condition: conds.value as components['schemas']['AllOfSeries'], + }, pageRequest: PageRequest.FromPageSize(appStore.browsingPageSize, page0.value), - } -}) + }), +) watch(series, (newSeries) => { if (newSeries) pageCount.value = newSeries.totalPages ?? 0