Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: #148 파일 타입 & 일정 타입 추가 및 수정
Browse files Browse the repository at this point in the history
Seok93 committed Sep 24, 2024
1 parent f804bef commit 69daab2
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 7 additions & 1 deletion src/types/FileType.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
export type CustomFile = { id: string; file: File };
export type CustomFile = {
fileId: string;
fileName: string;
file: File;
};

export type TaskFile = {
fileId: number;
fileName: string;
fileUrl: string;
};

export type FileInfo = TaskFile | CustomFile;
13 changes: 6 additions & 7 deletions src/types/TaskType.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Assignee } from '@/types/AssigneeType';
import type { UserWithRole } from '@/types/UserType';
import type { ProjectStatus } from '@/types/ProjectStatusType';

type RenameKeys<T, R extends { [K in keyof R]: K extends keyof T ? string : never }> = {
@@ -22,12 +22,11 @@ export type Task = {
export type TaskOrder = Pick<Task, 'statusId' | 'taskId' | 'sortOrder'>;
export type TaskOrderForm = { tasks: TaskOrder[] };

export type TaskForm = Omit<Task, 'taskId'> & {
assignees: Assignee['userId'][];
files: File[];
};
export type TaskInfoForm = Omit<TaskForm, 'files'>;
export type TaskFileForm = Pick<TaskForm, 'files'>;
export type TaskInfoForm = Omit<Task, 'taskId'>;
export type TaskAssigneeForm = { assignees: UserWithRole['userId'][] };
export type TaskFileForm = { files: File[] };
export type TaskCreationForm = TaskInfoForm & TaskAssigneeForm;
export type TaskForm = TaskInfoForm & TaskAssigneeForm & TaskFileForm;

export type TaskWithStatus = RenameKeys<Omit<ProjectStatus, 'projectId'>, StatusKeyMapping> & Task;
export type TaskListWithStatus = Omit<ProjectStatus, 'projectId'> & { tasks: Task[] };

0 comments on commit 69daab2

Please sign in to comment.