Skip to content

Commit 41d0a0a

Browse files
committed
Merge branch 'main' of github.com:ArianHamdi/todo-topia
2 parents e745dcd + d6fa03f commit 41d0a0a

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

src/pages/api/task/[id].ts

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default withAuthorization(async function handler(
2121
description,
2222
deadline,
2323
repeat,
24+
status,
2425
});
2526

2627
const task = await prisma.task.findUnique({

src/pages/api/task/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default withAuthorization(async function handler(
1717
description,
1818
deadline,
1919
repeat,
20+
status: false,
2021
});
2122
console.log('USER', userId);
2223
const newTask = await prisma.task.create({

src/schema/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ export const categorySchema = yup.object().shape({
88
export const todoListSchema = yup.object().shape({
99
title: yup.string().required(),
1010
categoryId: yup.string().required(),
11+
left: yup.number(),
12+
completed: yup.number(),
1113
});
1214

1315
export const taskSchema = yup.object().shape({
1416
title: yup.string().required(),
1517
description: yup.string(),
1618
deadline: yup.date(),
1719
repeat: yup.string().oneOf(['daily', 'weekly', 'monthly']),
20+
status: yup.boolean().required(),
1821
});

src/types/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface ITask {
99
description?: string;
1010
deadline?: Date;
1111
repeat?: string;
12+
status: boolean;
1213
}
1314

1415
export type ITaskPost = Omit<ITask, 'id'>;
@@ -19,6 +20,8 @@ export interface ITodoList {
1920
id: string;
2021
title: string;
2122
categoryId: string;
23+
left: number;
24+
completed: number;
2225
tasks: ITask[];
2326
}
2427
export type ITodoListPost = Pick<ITodoList, 'title' | 'categoryId'>;

0 commit comments

Comments
 (0)