Fix: 변경된 쿼리에 따른 변경, Eslint 등 에러 제거

This commit is contained in:
정현조 2024-09-19 15:06:16 +09:00
parent 3e6b8e9df6
commit bd639f33bb
10 changed files with 30 additions and 73 deletions

View File

@ -6,7 +6,7 @@ import { Form, FormControl, FormField, FormItem, FormMessage } from '../ui/form'
import { Input } from '../ui/input';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select';
import { ProjectMemberResponse } from '@/types';
import { useUpdateProjectMemberPrivilege } from '@/hooks/useProjectHooks';
import useUpdateProjectMemberPrivilegeQuery from '@/queries/projects/useUpdateProjectMemberPrivilegeQuery';
type Role = 'ADMIN' | 'MANAGER' | 'EDITOR' | 'VIEWER';
@ -37,7 +37,7 @@ interface AdminMemberManageFormProps {
export default function AdminMemberManageForm({ members }: AdminMemberManageFormProps) {
const { projectId } = useParams<{ projectId: string }>();
const { mutate: updatePrivilege } = useUpdateProjectMemberPrivilege();
const { mutate: updatePrivilege } = useUpdateProjectMemberPrivilegeQuery();
const form = useForm<MemberManageFormValues>({
resolver: zodResolver(formSchema),

View File

@ -1,9 +1,9 @@
import { useState } from 'react';
import AdminMemberManageForm from './AdminMemberManageForm';
import { useParams } from 'react-router-dom';
import useProjectMembersQuery from '@/queries/useProjectMembersQuery';
import useProjectMembersQuery from '@/queries/projects/useProjectMembersQuery';
import useAuthStore from '@/stores/useAuthStore';
import { useAddProjectMember } from '@/hooks/useProjectHooks';
import useAddProjectMemberQuery from '@/queries/projects/useAddProjectMemberQuery';
import MemberAddModal from '../MemberAddModal';
import { MemberAddFormValues } from '../MemberAddModal/MemberAddForm';
@ -13,7 +13,7 @@ export default function AdminMemberManage() {
const memberId = profile?.id || 0;
const { data: members = [] } = useProjectMembersQuery(Number(projectId), memberId);
const addProjectMember = useAddProjectMember();
const addProjectMember = useAddProjectMemberQuery();
const [, setInviteModalOpen] = useState(false);

View File

@ -1,8 +1,8 @@
import { ResizablePanel, ResizableHandle } from '../ui/resizable';
import { useNavigate, useParams } from 'react-router-dom';
import { SquarePen } from 'lucide-react';
import useProjectListQuery from '@/queries/useProjectListQuery';
import { useCreateProject } from '@/hooks/useProjectHooks';
import useProjectListQuery from '@/queries/projects/useProjectListQuery';
import useCreateProjectQuery from '@/queries/projects/useCreateProjectQuery';
import { ProjectRequest } from '@/types';
import useAuthStore from '@/stores/useAuthStore';
import ProjectCreateModal from '../ProjectCreateModal';
@ -17,7 +17,7 @@ export default function AdminProjectSidebar(): JSX.Element {
const projects = projectsResponse?.workspaceResponses ?? [];
const createProject = useCreateProject();
const createProject = useCreateProjectQuery();
const handleCreateProject = (data: ProjectRequest) => {
createProject.mutate({

View File

@ -1,4 +1,4 @@
import { useHandleOAuthCallback } from '@/hooks/useOAuthCallbackHooks';
import useHandleOAuthCallback from '@/hooks/useOAuthCallbackHooks';
import { useNavigate } from 'react-router-dom';
import { useEffect } from 'react';
import useAuthStore from '@/stores/useAuthStore';

View File

@ -1,5 +1,6 @@
import useReviewDetailQuery from '@/queries/useReviewDetailQuery';
import { useUpdateReview, useDeleteReview } from '@/hooks/useReviewHooks';
import useReviewDetailQuery from '@/queries/reviews/useReviewDetailQuery';
import useUpdateReviewQuery from '@/queries/reviews/useUpdateReviewQuery';
import useDeleteReviewQuery from '@/queries/reviews/useDeleteReviewQuery';
import { useParams } from 'react-router-dom';
export default function ReviewDetail() {
@ -7,8 +8,8 @@ export default function ReviewDetail() {
const memberId = 1;
const { data: reviewDetail } = useReviewDetailQuery(Number(projectId), Number(reviewId), memberId);
const updateReview = useUpdateReview();
const deleteReview = useDeleteReview();
const updateReview = useUpdateReviewQuery();
const deleteReview = useDeleteReviewQuery();
const handleUpdate = () => {
updateReview.mutate({

View File

@ -1,8 +1,8 @@
import { useState } from 'react';
import ReviewItem from './ReviewItem';
import ReviewSearchInput from './ReviewSearchInput';
import useReviewByStatusQuery from '@/queries/useReviewByStatusQuery';
import useProjectQuery from '@/queries/useProjectQuery';
import useReviewByStatusQuery from '@/queries/reviews/useReviewByStatusQuery';
import useProjectQuery from '@/queries/projects/useProjectQuery';
import useAuthStore from '@/stores/useAuthStore';
import { useParams } from 'react-router-dom';

View File

@ -4,8 +4,8 @@ import Header from '../Header';
import useAuthStore from '@/stores/useAuthStore';
import WorkSpaceCreateModal from '../WorkSpaceCreateModal';
import { WorkspaceRequest, WorkspaceResponse } from '@/types';
import useWorkspaceListQuery from '@/queries/useWorkspaceListQuery';
import { useCreateWorkspace } from '@/hooks/useWorkspaceHooks';
import useWorkspaceListQuery from '@/queries/workspaces/useWorkspaceListQuery';
import useCreateWorkspaceQuery from '@/queries/workspaces/useCreateWorkspaceQuery';
export default function WorkspaceBrowseLayout() {
const { profile, isLoggedIn } = useAuthStore();
@ -19,7 +19,7 @@ export default function WorkspaceBrowseLayout() {
}, [isLoggedIn, memberId, navigate]);
const { data: workspacesResponse } = useWorkspaceListQuery(memberId ?? 0);
const createWorkspace = useCreateWorkspace();
const createWorkspace = useCreateWorkspaceQuery();
const handleCreateWorkspace = (data: WorkspaceRequest) => {
createWorkspace.mutate({

View File

@ -1,46 +0,0 @@
import '@/index.css';
import { Meta } from '@storybook/react';
import WorkspaceLabelBar from '.';
import { Label } from '@/types';
const meta: Meta<typeof WorkspaceLabelBar> = {
title: 'Workspace/WorkspaceLabelBar',
component: WorkspaceLabelBar,
parameters: {
layout: 'fullscreen',
},
};
export default meta;
const labels: Label[] = [
{
id: 1,
name: 'Label 1',
color: '#FFaa33',
type: 'rect',
coordinates: [],
},
{
id: 2,
name: 'Label 2',
color: '#aaFF55',
type: 'rect',
coordinates: [],
},
{
id: 3,
name: 'Label 3',
color: '#77aaFF',
type: 'rect',
coordinates: [],
},
];
export const Default = () => {
return (
<div className="flex h-screen justify-end">
<WorkspaceLabelBar labels={labels} />
</div>
);
};

View File

@ -1,14 +1,15 @@
import { useEffect, useState } from 'react';
import { useParams, Outlet } from 'react-router-dom';
import Header from '../Header';
import { Project } from '@/types';
import { ResizablePanelGroup, ResizablePanel } from '../ui/resizable';
import { Label, Project } from '@/types';
import { ResizablePanelGroup } from '../ui/resizable';
// import { ResizablePanel } from '../ui/resizable';
import WorkspaceSidebar from '../WorkspaceSidebar';
import useAuthStore from '@/stores/useAuthStore';
import useCanvasStore from '@/stores/useCanvasStore';
import useFolderQuery from '@/queries/useFolderQuery';
import useWorkspaceQuery from '@/queries/useWorkspaceQuery';
import useProjectListQuery from '@/queries/useProjectListQuery';
import useFolderQuery from '@/queries/folders/useFolderQuery';
import useWorkspaceQuery from '@/queries/workspaces/useWorkspaceQuery';
import useProjectListQuery from '@/queries/projects/useProjectListQuery';
const mockLabels: Label[] = [
{

View File

@ -4,9 +4,9 @@ import { Smile } from 'lucide-react';
import ProjectCreateModal from '../components/ProjectCreateModal';
import useAuthStore from '@/stores/useAuthStore';
import { ProjectResponse, ProjectRequest } from '@/types';
import useProjectListQuery from '@/queries/useProjectListQuery';
import useWorkspaceQuery from '@/queries/useWorkspaceQuery';
import { useCreateProject } from '@/hooks/useProjectHooks';
import useProjectListQuery from '@/queries/projects/useProjectListQuery';
import useWorkspaceQuery from '@/queries/workspaces/useWorkspaceQuery';
import useCreateProjectQuery from '@/queries/projects/useCreateProjectQuery';
import { webPath } from '@/router';
export default function WorkspaceBrowseDetail() {
@ -18,7 +18,8 @@ export default function WorkspaceBrowseDetail() {
const { data: workspaceData } = useWorkspaceQuery(workspaceId, memberId);
const { data: projectsResponse, isError } = useProjectListQuery(workspaceId, memberId);
const createProject = useCreateProject();
const createProject = useCreateProjectQuery();
const handleCreateProject = (data: ProjectRequest) => {
createProject.mutate({