ErrorComponent, 404Component, Theming

This commit is contained in:
2024-07-29 16:03:27 +02:00
parent e6fcd54e22
commit bf2f4954ee
27 changed files with 412 additions and 156 deletions
+6 -9
View File
@@ -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) }),
});