ErrorComponent, 404Component, Theming
This commit is contained in:
@@ -3,18 +3,15 @@ import { useApi } from '../api/Api';
|
||||
|
||||
export const profileSelfQueryOptions = (Api: ReturnType<typeof useApi>) =>
|
||||
queryOptions({
|
||||
queryKey: ['profile'],
|
||||
queryFn: async () => await Api.user(),
|
||||
queryKey: ['profile', { id: Api.authenticatedUser?.id }],
|
||||
queryFn: async () => ({
|
||||
user: await Api.user(),
|
||||
posts: await Api.userPosts(Api.authenticatedUser?.id ?? 0),
|
||||
}),
|
||||
});
|
||||
|
||||
export const profileQueryOptions = (Api: ReturnType<typeof useApi>, id?: number) =>
|
||||
queryOptions({
|
||||
queryKey: ['profile', { id }],
|
||||
queryFn: async () => await Api.user(id),
|
||||
});
|
||||
|
||||
export const profilePostsQueryOptions = (Api: ReturnType<typeof useApi>, id: number) =>
|
||||
queryOptions({
|
||||
queryKey: ['profilePosts', { id }],
|
||||
queryFn: async () => await Api.userPosts(id),
|
||||
queryFn: async () => ({ user: await Api.user(id), posts: await Api.userPosts(id) }),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user