Added Ability to add Due Dates to Cards

This commit is contained in:
Ahmad 2024-03-15 17:01:41 -04:00
parent be1ddcb0ad
commit 8ef97bf854
No known key found for this signature in database
GPG key ID: 8FD8A93530D182BF
8 changed files with 207 additions and 4 deletions

View file

@ -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,
},
});

View file

@ -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(),
});