feat(18-05): add public profile page and setup visibility toggle
- Create public profile page at /users/$userId with avatar, name, bio, setups - Create PublicSetupCard component for profile page setup listing - Add isPublic toggle button on setup detail page - Add Public badge to SetupCard in list view - Update useSetups hook with isPublic field on interfaces
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
interface SetupListItem {
|
||||
id: number;
|
||||
name: string;
|
||||
isPublic: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
itemCount: number;
|
||||
@@ -38,6 +39,7 @@ interface SetupItemWithCategory {
|
||||
interface SetupWithItems {
|
||||
id: number;
|
||||
name: string;
|
||||
isPublic: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
items: SetupItemWithCategory[];
|
||||
@@ -76,7 +78,7 @@ export function useCreateSetup() {
|
||||
export function useUpdateSetup(setupId: number) {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: (data: { name?: string }) =>
|
||||
mutationFn: (data: { name?: string; isPublic?: boolean }) =>
|
||||
apiPut<SetupListItem>(`/api/setups/${setupId}`, data),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ["setups"] });
|
||||
|
||||
Reference in New Issue
Block a user