feat: watchlist (premium), mobile bottom nav
Build & Push Docker Image / build (push) Successful in 2m35s
Build & Push Docker Image / build (push) Successful in 2m35s
This commit is contained in:
@@ -335,6 +335,7 @@ export const UserPreferencesDensity = {
|
||||
export interface UserPreferences {
|
||||
view?: UserPreferencesView;
|
||||
density?: UserPreferencesDensity;
|
||||
watchlist?: number[];
|
||||
}
|
||||
|
||||
export interface ErrorResponse {
|
||||
|
||||
@@ -2199,6 +2199,83 @@ export const useUpdateMePreferences = <TError = ErrorType<ErrorResponse>,
|
||||
return useMutation(getUpdateMePreferencesMutationOptions(options));
|
||||
}
|
||||
|
||||
export const getGetMeWatchlistUrl = () => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/auth/me/watchlist`
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get current user's watchlist tools (premium)
|
||||
*/
|
||||
export const getMeWatchlist = async ( options?: RequestInit): Promise<ToolWithStats[]> => {
|
||||
|
||||
return customFetch<ToolWithStats[]>(getGetMeWatchlistUrl(),
|
||||
{
|
||||
...options,
|
||||
method: 'GET'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getGetMeWatchlistQueryKey = () => {
|
||||
return [
|
||||
`/api/auth/me/watchlist`
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getGetMeWatchlistQueryOptions = <TData = Awaited<ReturnType<typeof getMeWatchlist>>, TError = ErrorType<ErrorResponse>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMeWatchlist>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getGetMeWatchlistQueryKey();
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMeWatchlist>>> = ({ signal }) => getMeWatchlist({ signal, ...requestOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getMeWatchlist>>, TError, TData> & { queryKey: QueryKey }
|
||||
}
|
||||
|
||||
export type GetMeWatchlistQueryResult = NonNullable<Awaited<ReturnType<typeof getMeWatchlist>>>
|
||||
export type GetMeWatchlistQueryError = ErrorType<ErrorResponse>
|
||||
|
||||
|
||||
/**
|
||||
* @summary Get current user's watchlist tools (premium)
|
||||
*/
|
||||
|
||||
export function useGetMeWatchlist<TData = Awaited<ReturnType<typeof getMeWatchlist>>, TError = ErrorType<ErrorResponse>>(
|
||||
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMeWatchlist>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
||||
|
||||
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
||||
|
||||
const queryOptions = getGetMeWatchlistQueryOptions(options)
|
||||
|
||||
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
||||
|
||||
return { ...query, queryKey: queryOptions.queryKey };
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getListUsersUrl = () => {
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user