fix(weekly-view): hide individual scrollbars and fix task creation P2003 error
This commit is contained in:
parent
5b95ede85a
commit
5dad5aa492
@ -10,7 +10,6 @@ datasource db {
|
||||
|
||||
model User {
|
||||
id String @id @default(cuid())
|
||||
accountNumber Int @unique @default(autoincrement())
|
||||
email String @unique
|
||||
passwordHash String?
|
||||
name String?
|
||||
@ -77,7 +76,6 @@ model User {
|
||||
dateAlignment String @default("center")
|
||||
hourLabelFormat String @default("short")
|
||||
showSubHourSlots Boolean @default(true)
|
||||
dayHeaderGap String? @default("0.75em")
|
||||
allDayPosition String @default("above")
|
||||
cwColor String? @default("#333333")
|
||||
cwFontFamily String? @default("Oswald")
|
||||
@ -88,15 +86,17 @@ model User {
|
||||
yearFontSize String? @default("1.5rem")
|
||||
yearFontWeight String? @default("700")
|
||||
showTaskCheckboxes Boolean @default(false)
|
||||
emailVerificationCode String?
|
||||
dayHeaderGap String? @default("0.75em")
|
||||
accountNumber Int @unique @default(autoincrement())
|
||||
showCompletedTasks Boolean @default(true)
|
||||
showLines Boolean @default(true)
|
||||
startDayOffset Int @default(-1)
|
||||
quoteSourceUrls String[] @default([])
|
||||
emailVerificationCode String?
|
||||
accounts Account[]
|
||||
projects Project[]
|
||||
cachedCalendarEvents CachedCalendarEvent[]
|
||||
calendarConnections CalendarConnection[]
|
||||
projects Project[]
|
||||
sessions Session[]
|
||||
somedayLists SomedayList[]
|
||||
tasks Task[]
|
||||
@ -166,12 +166,12 @@ model Task {
|
||||
lastSyncedAt DateTime?
|
||||
deletedAt DateTime?
|
||||
parentTaskId String?
|
||||
projectId String?
|
||||
somedaySlotIndex Int?
|
||||
projectId String?
|
||||
parent Task? @relation("SubTasks", fields: [parentTaskId], references: [id], onDelete: Cascade)
|
||||
subTasks Task[] @relation("SubTasks")
|
||||
project Project? @relation(fields: [projectId], references: [id])
|
||||
somedayList SomedayList? @relation(fields: [somedayListId], references: [id])
|
||||
project Project? @relation(fields: [projectId], references: [id], onDelete: SetNull)
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([userId, dayOfWeek])
|
||||
@ -225,9 +225,6 @@ model CachedCalendarEvent {
|
||||
title String
|
||||
description String?
|
||||
location String?
|
||||
url String?
|
||||
recurringEventId String?
|
||||
isRecurring Boolean @default(false)
|
||||
startDateTime DateTime?
|
||||
startDate String?
|
||||
endDateTime DateTime?
|
||||
@ -236,6 +233,9 @@ model CachedCalendarEvent {
|
||||
syncedAt DateTime @default(now())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
url String?
|
||||
recurringEventId String?
|
||||
isRecurring Boolean @default(false)
|
||||
connection CalendarConnection @relation(fields: [connectionId], references: [id], onDelete: Cascade)
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
|
||||
@ -218,6 +218,21 @@ export async function POST(request: NextRequest) {
|
||||
isRolling = user?.autoRolling || false;
|
||||
}
|
||||
|
||||
console.log('API POST - Creating task for user:', userId);
|
||||
|
||||
// Safety check: ensure user exists before creation to provide better error
|
||||
const userExists = await prisma.user.findUnique({
|
||||
where: { id: userId }
|
||||
});
|
||||
|
||||
if (!userExists) {
|
||||
console.error('CRITICAL: User ID in session does not exist in database:', userId);
|
||||
return NextResponse.json(
|
||||
{ error: 'User does not exist in database. Please log out and back in.' },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
const task = await prisma.task.create({
|
||||
data: {
|
||||
title,
|
||||
|
||||
@ -601,9 +601,6 @@ h3 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 400px;
|
||||
max-height: calc(100vh - 200px);
|
||||
overflow-y: auto;
|
||||
overflow-x: visible;
|
||||
}
|
||||
|
||||
.weekly-day-column:first-child {
|
||||
@ -975,9 +972,19 @@ h3 {
|
||||
}
|
||||
|
||||
/* Ensure actions don't get clipped by the scrolling container */
|
||||
.time-slots-container {
|
||||
.time-slots-container,
|
||||
.time-column-slots {
|
||||
overflow-y: auto;
|
||||
overflow-x: visible;
|
||||
scrollbar-width: none;
|
||||
-ms-overflow-style: none;
|
||||
}
|
||||
|
||||
.time-slots-container::-webkit-scrollbar,
|
||||
.time-column-slots::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.dark .time-slot-task > .task-actions {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user