This commit is contained in:
@@ -17,7 +17,7 @@ export const POST: APIRoute = async ({ request, locals }) => {
|
||||
}
|
||||
|
||||
const body = await request.json();
|
||||
const { description, clientId, categoryId, startTime, endTime, tags } = body;
|
||||
const { description, clientId, startTime, endTime, tags } = body;
|
||||
|
||||
// Validation
|
||||
if (!clientId) {
|
||||
@@ -27,13 +27,6 @@ export const POST: APIRoute = async ({ request, locals }) => {
|
||||
});
|
||||
}
|
||||
|
||||
if (!categoryId) {
|
||||
return new Response(JSON.stringify({ error: "Category is required" }), {
|
||||
status: 400,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
}
|
||||
|
||||
if (!startTime) {
|
||||
return new Response(JSON.stringify({ error: "Start time is required" }), {
|
||||
status: 400,
|
||||
@@ -81,7 +74,6 @@ export const POST: APIRoute = async ({ request, locals }) => {
|
||||
const resourceValidation = await validateTimeEntryResources({
|
||||
organizationId: member.organizationId,
|
||||
clientId,
|
||||
categoryId,
|
||||
tagIds: Array.isArray(tags) ? tags : undefined,
|
||||
});
|
||||
|
||||
@@ -101,7 +93,6 @@ export const POST: APIRoute = async ({ request, locals }) => {
|
||||
userId: locals.user.id,
|
||||
organizationId: member.organizationId,
|
||||
clientId,
|
||||
categoryId,
|
||||
startTime: startDate,
|
||||
endTime: endDate,
|
||||
description: description || null,
|
||||
|
||||
Reference in New Issue
Block a user