1.0.0
This commit is contained in:
@@ -14,7 +14,6 @@ export const POST: APIRoute = async ({ params, locals, redirect }) => {
|
||||
return new Response(JSON.stringify({ error: 'Entry ID required' }), { status: 400 });
|
||||
}
|
||||
|
||||
// Verify the entry belongs to the user
|
||||
const entry = await db.select()
|
||||
.from(timeEntries)
|
||||
.where(and(
|
||||
@@ -27,7 +26,6 @@ export const POST: APIRoute = async ({ params, locals, redirect }) => {
|
||||
return new Response(JSON.stringify({ error: 'Entry not found' }), { status: 404 });
|
||||
}
|
||||
|
||||
// Delete the entry
|
||||
await db.delete(timeEntries)
|
||||
.where(eq(timeEntries.id, entryId))
|
||||
.run();
|
||||
|
||||
@@ -21,7 +21,6 @@ export const POST: APIRoute = async ({ request, locals }) => {
|
||||
return new Response('Category is required', { status: 400 });
|
||||
}
|
||||
|
||||
// Check for running entry
|
||||
const runningEntry = await db.select().from(timeEntries).where(
|
||||
and(
|
||||
eq(timeEntries.userId, locals.user.id),
|
||||
@@ -33,13 +32,11 @@ export const POST: APIRoute = async ({ request, locals }) => {
|
||||
return new Response('Timer already running', { status: 400 });
|
||||
}
|
||||
|
||||
// Get default org (first one)
|
||||
const member = await db.select().from(members).where(eq(members.userId, locals.user.id)).limit(1).get();
|
||||
if (!member) {
|
||||
return new Response('No organization found', { status: 400 });
|
||||
}
|
||||
|
||||
// Verify category belongs to user's organization
|
||||
const category = await db.select().from(categories).where(
|
||||
and(
|
||||
eq(categories.id, categoryId),
|
||||
@@ -64,7 +61,6 @@ export const POST: APIRoute = async ({ request, locals }) => {
|
||||
description,
|
||||
});
|
||||
|
||||
// Add tags if provided
|
||||
if (tags.length > 0) {
|
||||
await db.insert(timeEntryTags).values(
|
||||
tags.map((tagId: string) => ({
|
||||
|
||||
Reference in New Issue
Block a user