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 {
|
model User {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
accountNumber Int @unique @default(autoincrement())
|
|
||||||
email String @unique
|
email String @unique
|
||||||
passwordHash String?
|
passwordHash String?
|
||||||
name String?
|
name String?
|
||||||
@ -77,7 +76,6 @@ model User {
|
|||||||
dateAlignment String @default("center")
|
dateAlignment String @default("center")
|
||||||
hourLabelFormat String @default("short")
|
hourLabelFormat String @default("short")
|
||||||
showSubHourSlots Boolean @default(true)
|
showSubHourSlots Boolean @default(true)
|
||||||
dayHeaderGap String? @default("0.75em")
|
|
||||||
allDayPosition String @default("above")
|
allDayPosition String @default("above")
|
||||||
cwColor String? @default("#333333")
|
cwColor String? @default("#333333")
|
||||||
cwFontFamily String? @default("Oswald")
|
cwFontFamily String? @default("Oswald")
|
||||||
@ -88,15 +86,17 @@ model User {
|
|||||||
yearFontSize String? @default("1.5rem")
|
yearFontSize String? @default("1.5rem")
|
||||||
yearFontWeight String? @default("700")
|
yearFontWeight String? @default("700")
|
||||||
showTaskCheckboxes Boolean @default(false)
|
showTaskCheckboxes Boolean @default(false)
|
||||||
|
emailVerificationCode String?
|
||||||
|
dayHeaderGap String? @default("0.75em")
|
||||||
|
accountNumber Int @unique @default(autoincrement())
|
||||||
showCompletedTasks Boolean @default(true)
|
showCompletedTasks Boolean @default(true)
|
||||||
showLines Boolean @default(true)
|
showLines Boolean @default(true)
|
||||||
startDayOffset Int @default(-1)
|
startDayOffset Int @default(-1)
|
||||||
quoteSourceUrls String[] @default([])
|
quoteSourceUrls String[] @default([])
|
||||||
emailVerificationCode String?
|
|
||||||
accounts Account[]
|
accounts Account[]
|
||||||
projects Project[]
|
|
||||||
cachedCalendarEvents CachedCalendarEvent[]
|
cachedCalendarEvents CachedCalendarEvent[]
|
||||||
calendarConnections CalendarConnection[]
|
calendarConnections CalendarConnection[]
|
||||||
|
projects Project[]
|
||||||
sessions Session[]
|
sessions Session[]
|
||||||
somedayLists SomedayList[]
|
somedayLists SomedayList[]
|
||||||
tasks Task[]
|
tasks Task[]
|
||||||
@ -166,12 +166,12 @@ model Task {
|
|||||||
lastSyncedAt DateTime?
|
lastSyncedAt DateTime?
|
||||||
deletedAt DateTime?
|
deletedAt DateTime?
|
||||||
parentTaskId String?
|
parentTaskId String?
|
||||||
projectId String?
|
|
||||||
somedaySlotIndex Int?
|
somedaySlotIndex Int?
|
||||||
|
projectId String?
|
||||||
parent Task? @relation("SubTasks", fields: [parentTaskId], references: [id], onDelete: Cascade)
|
parent Task? @relation("SubTasks", fields: [parentTaskId], references: [id], onDelete: Cascade)
|
||||||
subTasks Task[] @relation("SubTasks")
|
subTasks Task[] @relation("SubTasks")
|
||||||
|
project Project? @relation(fields: [projectId], references: [id])
|
||||||
somedayList SomedayList? @relation(fields: [somedayListId], 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)
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
@@index([userId, dayOfWeek])
|
@@index([userId, dayOfWeek])
|
||||||
@ -225,9 +225,6 @@ model CachedCalendarEvent {
|
|||||||
title String
|
title String
|
||||||
description String?
|
description String?
|
||||||
location String?
|
location String?
|
||||||
url String?
|
|
||||||
recurringEventId String?
|
|
||||||
isRecurring Boolean @default(false)
|
|
||||||
startDateTime DateTime?
|
startDateTime DateTime?
|
||||||
startDate String?
|
startDate String?
|
||||||
endDateTime DateTime?
|
endDateTime DateTime?
|
||||||
@ -236,6 +233,9 @@ model CachedCalendarEvent {
|
|||||||
syncedAt DateTime @default(now())
|
syncedAt DateTime @default(now())
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
url String?
|
||||||
|
recurringEventId String?
|
||||||
|
isRecurring Boolean @default(false)
|
||||||
connection CalendarConnection @relation(fields: [connectionId], references: [id], onDelete: Cascade)
|
connection CalendarConnection @relation(fields: [connectionId], references: [id], onDelete: Cascade)
|
||||||
user User @relation(fields: [userId], 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;
|
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({
|
const task = await prisma.task.create({
|
||||||
data: {
|
data: {
|
||||||
title,
|
title,
|
||||||
|
|||||||
@ -601,9 +601,6 @@ h3 {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
min-height: 400px;
|
min-height: 400px;
|
||||||
max-height: calc(100vh - 200px);
|
|
||||||
overflow-y: auto;
|
|
||||||
overflow-x: visible;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.weekly-day-column:first-child {
|
.weekly-day-column:first-child {
|
||||||
@ -975,9 +972,19 @@ h3 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure actions don't get clipped by the scrolling container */
|
/* Ensure actions don't get clipped by the scrolling container */
|
||||||
.time-slots-container {
|
.time-slots-container,
|
||||||
|
.time-column-slots {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: visible;
|
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 {
|
.dark .time-slot-task > .task-actions {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user