diff --git a/next-ui/src/components/import/books/TransientBooksTable.vue b/next-ui/src/components/import/books/TransientBooksTable.vue index 3973bdf4..3b73e666 100644 --- a/next-ui/src/components/import/books/TransientBooksTable.vue +++ b/next-ui/src/components/import/books/TransientBooksTable.vue @@ -553,7 +553,7 @@ function fetchBooks(book: BookImport) { condition: { seriesId: { operator: 'Is', value: book.series!.id }, }, - } as components['schemas']['BookSearch'], + }, pageRequest: PageRequest.Unpaged(), }), ) diff --git a/next-ui/src/components/import/readlist/Table.vue b/next-ui/src/components/import/readlist/Table.vue index 3471298f..da5a3761 100644 --- a/next-ui/src/components/import/readlist/Table.vue +++ b/next-ui/src/components/import/readlist/Table.vue @@ -492,7 +492,7 @@ const getSeriesBooks = useMemoize(async (seriesId: string) => condition: { seriesId: { operator: 'Is', value: seriesId }, }, - } as components['schemas']['BookSearch'], + }, }), ) .refresh() diff --git a/next-ui/src/pages/server/users.vue b/next-ui/src/pages/server/users.vue index 4c85e04d..1de5d4be 100644 --- a/next-ui/src/pages/server/users.vue +++ b/next-ui/src/pages/server/users.vue @@ -107,7 +107,7 @@ function showDialog(action: ACTION, user?: components['schemas']['UserDto']) { age: 0, restriction: 'NONE', }, - } as components['schemas']['UserCreationDto'] + } dialogConfirmEdit.value.callback = handleDialogConfirmation break case ACTION.EDIT: @@ -141,7 +141,7 @@ function showDialog(action: ACTION, user?: components['schemas']['UserDto']) { age: 0, restriction: 'NONE', }, - } as components['schemas']['UserUpdateDto'] + } dialogConfirmEdit.value.callback = handleDialogConfirmation break case ACTION.DELETE: diff --git a/next-ui/src/stores/app.ts b/next-ui/src/stores/app.ts index bfd89daa..a24d0da8 100644 --- a/next-ui/src/stores/app.ts +++ b/next-ui/src/stores/app.ts @@ -5,25 +5,38 @@ import type { PresentationMode } from '@/types/libraries' import type { PageSize, Paging } from '@/types/page' import type { Sort } from '@/types/PageRequest' +interface AppState { + drawer: boolean + theme: string + rememberMe: boolean + importBooksPath: string + browsingPageSize: PageSize + browsingPaging: Paging + presentationMode: Record + sortActive: Record + gridCardWidth: number + reorderLibraries: boolean +} + export const useAppStore = defineStore('app', { - state: () => ({ + state: (): AppState => ({ // persisted drawer: !useDisplay().mobile.value.valueOf(), theme: 'system', rememberMe: false, importBooksPath: '', - browsingPageSize: 20 as PageSize, - browsingPaging: 'scroll' as Paging, + browsingPageSize: 20, + browsingPaging: 'scroll', /** * Store the presentation mode per view. * Use the getter to ensure a default value is always set. */ - presentationMode: {} as Record, + presentationMode: {}, /** * Store the sort order per view. * Use the getter to ensure a default value is always set. */ - sortActive: {} as Record, + sortActive: {}, gridCardWidth: 150, // transient reorderLibraries: false, diff --git a/next-ui/src/stores/dialogs.ts b/next-ui/src/stores/dialogs.ts index 3a66fc03..35cc2ea4 100644 --- a/next-ui/src/stores/dialogs.ts +++ b/next-ui/src/stores/dialogs.ts @@ -2,12 +2,18 @@ import { defineStore } from 'pinia' import type { DialogConfirmEditProps, DialogConfirmProps, DialogSimpleProps } from '@/types/dialog' +interface DialogsState { + confirmEdit: DialogConfirmEditActivation + confirm: DialogConfirmActivation + simple: DialogSimpleActivation +} + /** * Reusable dialogs. * The single instances of the dialogs are created under App, and can be triggered by using this store. */ export const useDialogsStore = defineStore('dialogs', { - state: () => ({ + state: (): DialogsState => ({ confirmEdit: { dialogProps: {}, slot: { @@ -17,7 +23,7 @@ export const useDialogsStore = defineStore('dialogs', { }, record: undefined, callback: () => {}, - } as DialogConfirmEditActivation, + }, confirm: { dialogProps: {}, slotWarning: { @@ -26,7 +32,7 @@ export const useDialogsStore = defineStore('dialogs', { handlers: {}, }, callback: () => {}, - } as DialogConfirmActivation, + }, simple: { dialogProps: {}, slot: { @@ -35,7 +41,7 @@ export const useDialogsStore = defineStore('dialogs', { handlers: {}, }, callback: () => {}, - } as DialogSimpleActivation, + }, }), })