Fix: 변경된 쿼리에 따른 변경, Eslint 등 에러 제거
This commit is contained in:
parent
3e6b8e9df6
commit
bd639f33bb
@ -6,7 +6,7 @@ import { Form, FormControl, FormField, FormItem, FormMessage } from '../ui/form'
|
|||||||
import { Input } from '../ui/input';
|
import { Input } from '../ui/input';
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select';
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select';
|
||||||
import { ProjectMemberResponse } from '@/types';
|
import { ProjectMemberResponse } from '@/types';
|
||||||
import { useUpdateProjectMemberPrivilege } from '@/hooks/useProjectHooks';
|
import useUpdateProjectMemberPrivilegeQuery from '@/queries/projects/useUpdateProjectMemberPrivilegeQuery';
|
||||||
|
|
||||||
type Role = 'ADMIN' | 'MANAGER' | 'EDITOR' | 'VIEWER';
|
type Role = 'ADMIN' | 'MANAGER' | 'EDITOR' | 'VIEWER';
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ interface AdminMemberManageFormProps {
|
|||||||
|
|
||||||
export default function AdminMemberManageForm({ members }: AdminMemberManageFormProps) {
|
export default function AdminMemberManageForm({ members }: AdminMemberManageFormProps) {
|
||||||
const { projectId } = useParams<{ projectId: string }>();
|
const { projectId } = useParams<{ projectId: string }>();
|
||||||
const { mutate: updatePrivilege } = useUpdateProjectMemberPrivilege();
|
const { mutate: updatePrivilege } = useUpdateProjectMemberPrivilegeQuery();
|
||||||
|
|
||||||
const form = useForm<MemberManageFormValues>({
|
const form = useForm<MemberManageFormValues>({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import AdminMemberManageForm from './AdminMemberManageForm';
|
import AdminMemberManageForm from './AdminMemberManageForm';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
import useProjectMembersQuery from '@/queries/useProjectMembersQuery';
|
import useProjectMembersQuery from '@/queries/projects/useProjectMembersQuery';
|
||||||
import useAuthStore from '@/stores/useAuthStore';
|
import useAuthStore from '@/stores/useAuthStore';
|
||||||
import { useAddProjectMember } from '@/hooks/useProjectHooks';
|
import useAddProjectMemberQuery from '@/queries/projects/useAddProjectMemberQuery';
|
||||||
import MemberAddModal from '../MemberAddModal';
|
import MemberAddModal from '../MemberAddModal';
|
||||||
import { MemberAddFormValues } from '../MemberAddModal/MemberAddForm';
|
import { MemberAddFormValues } from '../MemberAddModal/MemberAddForm';
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ export default function AdminMemberManage() {
|
|||||||
const memberId = profile?.id || 0;
|
const memberId = profile?.id || 0;
|
||||||
|
|
||||||
const { data: members = [] } = useProjectMembersQuery(Number(projectId), memberId);
|
const { data: members = [] } = useProjectMembersQuery(Number(projectId), memberId);
|
||||||
const addProjectMember = useAddProjectMember();
|
const addProjectMember = useAddProjectMemberQuery();
|
||||||
|
|
||||||
const [, setInviteModalOpen] = useState(false);
|
const [, setInviteModalOpen] = useState(false);
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { ResizablePanel, ResizableHandle } from '../ui/resizable';
|
import { ResizablePanel, ResizableHandle } from '../ui/resizable';
|
||||||
import { useNavigate, useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
import { SquarePen } from 'lucide-react';
|
import { SquarePen } from 'lucide-react';
|
||||||
import useProjectListQuery from '@/queries/useProjectListQuery';
|
import useProjectListQuery from '@/queries/projects/useProjectListQuery';
|
||||||
import { useCreateProject } from '@/hooks/useProjectHooks';
|
import useCreateProjectQuery from '@/queries/projects/useCreateProjectQuery';
|
||||||
import { ProjectRequest } from '@/types';
|
import { ProjectRequest } from '@/types';
|
||||||
import useAuthStore from '@/stores/useAuthStore';
|
import useAuthStore from '@/stores/useAuthStore';
|
||||||
import ProjectCreateModal from '../ProjectCreateModal';
|
import ProjectCreateModal from '../ProjectCreateModal';
|
||||||
@ -17,7 +17,7 @@ export default function AdminProjectSidebar(): JSX.Element {
|
|||||||
|
|
||||||
const projects = projectsResponse?.workspaceResponses ?? [];
|
const projects = projectsResponse?.workspaceResponses ?? [];
|
||||||
|
|
||||||
const createProject = useCreateProject();
|
const createProject = useCreateProjectQuery();
|
||||||
|
|
||||||
const handleCreateProject = (data: ProjectRequest) => {
|
const handleCreateProject = (data: ProjectRequest) => {
|
||||||
createProject.mutate({
|
createProject.mutate({
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { useHandleOAuthCallback } from '@/hooks/useOAuthCallbackHooks';
|
import useHandleOAuthCallback from '@/hooks/useOAuthCallbackHooks';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import useAuthStore from '@/stores/useAuthStore';
|
import useAuthStore from '@/stores/useAuthStore';
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import useReviewDetailQuery from '@/queries/useReviewDetailQuery';
|
import useReviewDetailQuery from '@/queries/reviews/useReviewDetailQuery';
|
||||||
import { useUpdateReview, useDeleteReview } from '@/hooks/useReviewHooks';
|
import useUpdateReviewQuery from '@/queries/reviews/useUpdateReviewQuery';
|
||||||
|
import useDeleteReviewQuery from '@/queries/reviews/useDeleteReviewQuery';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
|
|
||||||
export default function ReviewDetail() {
|
export default function ReviewDetail() {
|
||||||
@ -7,8 +8,8 @@ export default function ReviewDetail() {
|
|||||||
const memberId = 1;
|
const memberId = 1;
|
||||||
|
|
||||||
const { data: reviewDetail } = useReviewDetailQuery(Number(projectId), Number(reviewId), memberId);
|
const { data: reviewDetail } = useReviewDetailQuery(Number(projectId), Number(reviewId), memberId);
|
||||||
const updateReview = useUpdateReview();
|
const updateReview = useUpdateReviewQuery();
|
||||||
const deleteReview = useDeleteReview();
|
const deleteReview = useDeleteReviewQuery();
|
||||||
|
|
||||||
const handleUpdate = () => {
|
const handleUpdate = () => {
|
||||||
updateReview.mutate({
|
updateReview.mutate({
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import ReviewItem from './ReviewItem';
|
import ReviewItem from './ReviewItem';
|
||||||
import ReviewSearchInput from './ReviewSearchInput';
|
import ReviewSearchInput from './ReviewSearchInput';
|
||||||
import useReviewByStatusQuery from '@/queries/useReviewByStatusQuery';
|
import useReviewByStatusQuery from '@/queries/reviews/useReviewByStatusQuery';
|
||||||
import useProjectQuery from '@/queries/useProjectQuery';
|
import useProjectQuery from '@/queries/projects/useProjectQuery';
|
||||||
import useAuthStore from '@/stores/useAuthStore';
|
import useAuthStore from '@/stores/useAuthStore';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ import Header from '../Header';
|
|||||||
import useAuthStore from '@/stores/useAuthStore';
|
import useAuthStore from '@/stores/useAuthStore';
|
||||||
import WorkSpaceCreateModal from '../WorkSpaceCreateModal';
|
import WorkSpaceCreateModal from '../WorkSpaceCreateModal';
|
||||||
import { WorkspaceRequest, WorkspaceResponse } from '@/types';
|
import { WorkspaceRequest, WorkspaceResponse } from '@/types';
|
||||||
import useWorkspaceListQuery from '@/queries/useWorkspaceListQuery';
|
import useWorkspaceListQuery from '@/queries/workspaces/useWorkspaceListQuery';
|
||||||
import { useCreateWorkspace } from '@/hooks/useWorkspaceHooks';
|
import useCreateWorkspaceQuery from '@/queries/workspaces/useCreateWorkspaceQuery';
|
||||||
|
|
||||||
export default function WorkspaceBrowseLayout() {
|
export default function WorkspaceBrowseLayout() {
|
||||||
const { profile, isLoggedIn } = useAuthStore();
|
const { profile, isLoggedIn } = useAuthStore();
|
||||||
@ -19,7 +19,7 @@ export default function WorkspaceBrowseLayout() {
|
|||||||
}, [isLoggedIn, memberId, navigate]);
|
}, [isLoggedIn, memberId, navigate]);
|
||||||
|
|
||||||
const { data: workspacesResponse } = useWorkspaceListQuery(memberId ?? 0);
|
const { data: workspacesResponse } = useWorkspaceListQuery(memberId ?? 0);
|
||||||
const createWorkspace = useCreateWorkspace();
|
const createWorkspace = useCreateWorkspaceQuery();
|
||||||
|
|
||||||
const handleCreateWorkspace = (data: WorkspaceRequest) => {
|
const handleCreateWorkspace = (data: WorkspaceRequest) => {
|
||||||
createWorkspace.mutate({
|
createWorkspace.mutate({
|
||||||
|
@ -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>
|
|
||||||
);
|
|
||||||
};
|
|
@ -1,14 +1,15 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useParams, Outlet } from 'react-router-dom';
|
import { useParams, Outlet } from 'react-router-dom';
|
||||||
import Header from '../Header';
|
import Header from '../Header';
|
||||||
import { Project } from '@/types';
|
import { Label, Project } from '@/types';
|
||||||
import { ResizablePanelGroup, ResizablePanel } from '../ui/resizable';
|
import { ResizablePanelGroup } from '../ui/resizable';
|
||||||
|
// import { ResizablePanel } from '../ui/resizable';
|
||||||
import WorkspaceSidebar from '../WorkspaceSidebar';
|
import WorkspaceSidebar from '../WorkspaceSidebar';
|
||||||
import useAuthStore from '@/stores/useAuthStore';
|
import useAuthStore from '@/stores/useAuthStore';
|
||||||
import useCanvasStore from '@/stores/useCanvasStore';
|
import useCanvasStore from '@/stores/useCanvasStore';
|
||||||
import useFolderQuery from '@/queries/useFolderQuery';
|
import useFolderQuery from '@/queries/folders/useFolderQuery';
|
||||||
import useWorkspaceQuery from '@/queries/useWorkspaceQuery';
|
import useWorkspaceQuery from '@/queries/workspaces/useWorkspaceQuery';
|
||||||
import useProjectListQuery from '@/queries/useProjectListQuery';
|
import useProjectListQuery from '@/queries/projects/useProjectListQuery';
|
||||||
|
|
||||||
const mockLabels: Label[] = [
|
const mockLabels: Label[] = [
|
||||||
{
|
{
|
||||||
|
@ -4,9 +4,9 @@ import { Smile } from 'lucide-react';
|
|||||||
import ProjectCreateModal from '../components/ProjectCreateModal';
|
import ProjectCreateModal from '../components/ProjectCreateModal';
|
||||||
import useAuthStore from '@/stores/useAuthStore';
|
import useAuthStore from '@/stores/useAuthStore';
|
||||||
import { ProjectResponse, ProjectRequest } from '@/types';
|
import { ProjectResponse, ProjectRequest } from '@/types';
|
||||||
import useProjectListQuery from '@/queries/useProjectListQuery';
|
import useProjectListQuery from '@/queries/projects/useProjectListQuery';
|
||||||
import useWorkspaceQuery from '@/queries/useWorkspaceQuery';
|
import useWorkspaceQuery from '@/queries/workspaces/useWorkspaceQuery';
|
||||||
import { useCreateProject } from '@/hooks/useProjectHooks';
|
import useCreateProjectQuery from '@/queries/projects/useCreateProjectQuery';
|
||||||
import { webPath } from '@/router';
|
import { webPath } from '@/router';
|
||||||
|
|
||||||
export default function WorkspaceBrowseDetail() {
|
export default function WorkspaceBrowseDetail() {
|
||||||
@ -18,7 +18,8 @@ export default function WorkspaceBrowseDetail() {
|
|||||||
|
|
||||||
const { data: workspaceData } = useWorkspaceQuery(workspaceId, memberId);
|
const { data: workspaceData } = useWorkspaceQuery(workspaceId, memberId);
|
||||||
const { data: projectsResponse, isError } = useProjectListQuery(workspaceId, memberId);
|
const { data: projectsResponse, isError } = useProjectListQuery(workspaceId, memberId);
|
||||||
const createProject = useCreateProject();
|
|
||||||
|
const createProject = useCreateProjectQuery();
|
||||||
|
|
||||||
const handleCreateProject = (data: ProjectRequest) => {
|
const handleCreateProject = (data: ProjectRequest) => {
|
||||||
createProject.mutate({
|
createProject.mutate({
|
||||||
|
Loading…
Reference in New Issue
Block a user