Replace mutation error types with AxiosError

This commit is contained in:
jeffvli 2023-05-09 05:53:57 -07:00
parent 3efeaa7359
commit a19673d3c2
10 changed files with 21 additions and 21 deletions

View File

@ -1,5 +1,5 @@
import { useQueryClient, useMutation } from '@tanstack/react-query';
import { HTTPError } from 'ky';
import { AxiosError } from 'axios';
import { api } from '/@/renderer/api';
import { NDAlbumDetail, NDAlbumArtistDetail } from '/@/renderer/api/navidrome.types';
import { queryKeys } from '/@/renderer/api/query-keys';
@ -22,7 +22,7 @@ export const useUpdateRating = () => {
return useMutation<
RatingResponse,
HTTPError,
AxiosError,
Omit<SetRatingArgs, 'server' | 'apiClientProps'>,
{ previous: { items: AnyLibraryItems } | undefined }
>({

View File

@ -1,5 +1,5 @@
import { useMutation } from '@tanstack/react-query';
import { HTTPError } from 'ky';
import { AxiosError } from 'axios';
import { api } from '/@/renderer/api';
import { ScrobbleResponse, ScrobbleArgs } from '/@/renderer/api/types';
import { MutationOptions } from '/@/renderer/lib/react-query';
@ -10,7 +10,7 @@ export const useSendScrobble = (options?: MutationOptions) => {
return useMutation<
ScrobbleResponse,
HTTPError,
AxiosError,
Omit<ScrobbleArgs, 'server' | 'apiClientProps'>,
null
>({

View File

@ -1,5 +1,5 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { HTTPError } from 'ky';
import { AxiosError } from 'axios';
import { api } from '/@/renderer/api';
import { queryKeys } from '/@/renderer/api/query-keys';
import { AddToPlaylistArgs, AddToPlaylistResponse } from '/@/renderer/api/types';
@ -12,7 +12,7 @@ export const useAddToPlaylist = (args: MutationHookArgs) => {
return useMutation<
AddToPlaylistResponse,
HTTPError,
AxiosError,
Omit<AddToPlaylistArgs, 'server' | 'apiClientProps'>,
null
>({

View File

@ -1,9 +1,9 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { HTTPError } from 'ky';
import { api } from '/@/renderer/api';
import { CreatePlaylistArgs, CreatePlaylistResponse } from '/@/renderer/api/types';
import { MutationHookArgs } from '/@/renderer/lib/react-query';
import { getServerById } from '/@/renderer/store';
import { AxiosError } from 'axios';
import { queryKeys } from '../../../api/query-keys';
export const useCreatePlaylist = (args: MutationHookArgs) => {
@ -12,7 +12,7 @@ export const useCreatePlaylist = (args: MutationHookArgs) => {
return useMutation<
CreatePlaylistResponse,
HTTPError,
AxiosError,
Omit<CreatePlaylistArgs, 'server' | 'apiClientProps'>,
null
>({

View File

@ -1,5 +1,5 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { HTTPError } from 'ky';
import { AxiosError } from 'axios';
import { api } from '/@/renderer/api';
import { queryKeys } from '/@/renderer/api/query-keys';
import { DeletePlaylistArgs, DeletePlaylistResponse } from '/@/renderer/api/types';
@ -13,7 +13,7 @@ export const useDeletePlaylist = (args: MutationHookArgs) => {
return useMutation<
DeletePlaylistResponse,
HTTPError,
AxiosError,
Omit<DeletePlaylistArgs, 'server' | 'apiClientProps'>,
null
>({

View File

@ -1,8 +1,8 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { HTTPError } from 'ky';
import { AxiosError } from 'axios';
import { api } from '/@/renderer/api';
import { queryKeys } from '/@/renderer/api/query-keys';
import { RemoveFromPlaylistResponse, RemoveFromPlaylistArgs } from '/@/renderer/api/types';
import { RemoveFromPlaylistArgs, RemoveFromPlaylistResponse } from '/@/renderer/api/types';
import { MutationOptions } from '/@/renderer/lib/react-query';
import { getServerById } from '/@/renderer/store';
@ -11,7 +11,7 @@ export const useRemoveFromPlaylist = (options?: MutationOptions) => {
return useMutation<
RemoveFromPlaylistResponse,
HTTPError,
AxiosError,
Omit<RemoveFromPlaylistArgs, 'server' | 'apiClientProps'>,
null
>({

View File

@ -1,5 +1,5 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { HTTPError } from 'ky';
import { AxiosError } from 'axios';
import { api } from '/@/renderer/api';
import { queryKeys } from '/@/renderer/api/query-keys';
import { UpdatePlaylistArgs, UpdatePlaylistResponse } from '/@/renderer/api/types';
@ -12,7 +12,7 @@ export const useUpdatePlaylist = (args: MutationHookArgs) => {
return useMutation<
UpdatePlaylistResponse,
HTTPError,
AxiosError,
Omit<UpdatePlaylistArgs, 'server' | 'apiClientProps'>,
null
>({

View File

@ -1,5 +1,5 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { HTTPError } from 'ky';
import { AxiosError } from 'axios';
import { api } from '/@/renderer/api';
import { queryKeys } from '/@/renderer/api/query-keys';
import {
@ -20,7 +20,7 @@ export const useCreateFavorite = (args: MutationHookArgs) => {
return useMutation<
FavoriteResponse,
HTTPError,
AxiosError,
Omit<FavoriteArgs, 'server' | 'apiClientProps'>,
null
>({

View File

@ -1,5 +1,5 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { HTTPError } from 'ky';
import { AxiosError } from 'axios';
import { api } from '/@/renderer/api';
import { queryKeys } from '/@/renderer/api/query-keys';
import {
@ -20,7 +20,7 @@ export const useDeleteFavorite = (args: MutationHookArgs) => {
return useMutation<
FavoriteResponse,
HTTPError,
AxiosError,
Omit<FavoriteArgs, 'server' | 'apiClientProps'>,
null
>({

View File

@ -1,5 +1,5 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { HTTPError } from 'ky';
import { AxiosError } from 'axios';
import { api } from '/@/renderer/api';
import { queryKeys } from '/@/renderer/api/query-keys';
import {
@ -23,7 +23,7 @@ export const useSetRating = (args: MutationHookArgs) => {
return useMutation<
RatingResponse,
HTTPError,
AxiosError,
Omit<SetRatingArgs, 'server' | 'apiClientProps'>,
{ previous: { items: AnyLibraryItems } | undefined }
>({