Post delete, Profile edit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { queryOptions } from '@tanstack/react-query';
|
||||
import Api from '../api/Api';
|
||||
|
||||
export const postsQueryOptions = (page?: number) =>
|
||||
queryOptions({
|
||||
queryKey: ['posts', { page: page ?? 0, hasAuth: Api.hasAuth() }],
|
||||
queryFn: () => Api.posts(page),
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
import { queryOptions } from '@tanstack/react-query';
|
||||
import Api from '../api/Api';
|
||||
|
||||
export const profileSelfQueryOptions = queryOptions({
|
||||
queryKey: ['profile'],
|
||||
queryFn: () => Api.user(),
|
||||
});
|
||||
|
||||
export const profileQueryOptions = (id?: number) =>
|
||||
queryOptions({
|
||||
queryKey: ['profile', { id }],
|
||||
queryFn: () => Api.user(id),
|
||||
});
|
||||
Reference in New Issue
Block a user