fix(preferences): ran a migration command so is_dark_mode = null is accepted in DB

This commit is contained in:
Matthieu Haineault 2025-12-03 14:23:59 -05:00
parent 35a71d217a
commit 5b0e0ce869
3 changed files with 12 additions and 7 deletions

View File

@ -0,0 +1,5 @@
-- CreateEnum
CREATE TYPE "modules" AS ENUM ('timesheets', 'timesheets_approval', 'employee_list', 'employee_management', 'personal_profile', 'dashboard');
-- AlterTable
ALTER TABLE "preferences" ALTER COLUMN "is_dark_mode" DROP NOT NULL;

View File

@ -53,7 +53,7 @@ model Employees {
supervisor Employees? @relation("EmployeeSupervisor", fields: [supervisor_id], references: [id])
supervisor_id Int?
external_payroll_id Int @default(autoincrement())
external_payroll_id Int @default(autoincrement())
company_code Int
first_work_day DateTime @db.Date
last_work_day DateTime? @db.Date
@ -347,12 +347,12 @@ model Preferences {
user Users @relation("UserPreferences", fields: [user_id], references: [id])
user_id String @unique @db.Uuid
notifications Boolean @default(true)
notifications Boolean @default(true)
is_dark_mode Boolean? @default(false)
display_language String @default("fr-FR") //'fr-FR' | 'en-CA';
is_lefty_mode Boolean @default(false)
is_employee_list_grid Boolean @default(true)
is_timesheet_approval_grid Boolean @default(true)
display_language String @default("fr-FR") //'fr-FR' | 'en-CA';
is_lefty_mode Boolean @default(false)
is_employee_list_grid Boolean @default(true)
is_timesheet_approval_grid Boolean @default(true)
@@map("preferences")
}

View File

@ -8,7 +8,7 @@ export enum DisplayLanguage {
export class PreferencesDto {
@IsInt() id: number;
@IsBoolean() notifications: boolean;
@IsOptional() @IsBoolean() is_dark_mode?: boolean;
@IsOptional() @IsBoolean() is_dark_mode?: boolean | null;
@IsEnum(DisplayLanguage) display_language: string;
@IsBoolean() is_lefty_mode: boolean;
@IsBoolean() is_employee_list_grid: boolean;