mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-05-04 04:33:10 +00:00
Added Ability to add Due Dates to Cards
This commit is contained in:
parent
be1ddcb0ad
commit
8ef97bf854
8 changed files with 207 additions and 4 deletions
|
@ -16,7 +16,7 @@ const handler = async (data: InputType): Promise<ReturnType> => {
|
|||
|
||||
if (!userId || !orgId) return { error: 'Unauthorized' };
|
||||
|
||||
const { id, boardId, ...values } = data;
|
||||
const { id, boardId, startedAt, dueDate, ...values } = data;
|
||||
let card;
|
||||
|
||||
try {
|
||||
|
@ -31,6 +31,7 @@ const handler = async (data: InputType): Promise<ReturnType> => {
|
|||
},
|
||||
data: {
|
||||
...values,
|
||||
dueDate: dueDate,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -22,5 +22,15 @@ export const UpdateCard = z.object({
|
|||
message: 'Title must be at least 3 characters',
|
||||
})
|
||||
),
|
||||
dueDate: z.optional(
|
||||
z.date({
|
||||
invalid_type_error: 'Due date must be a date',
|
||||
})
|
||||
),
|
||||
startedAt: z.optional(
|
||||
z.date({
|
||||
invalid_type_error: 'Due date must be a date',
|
||||
})
|
||||
),
|
||||
id: z.string(),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue