fix admn controller

This commit is contained in:
Mateusz Gruszczyński
2026-04-06 16:29:58 +02:00
parent 78a0b21e48
commit 723e3441df
10 changed files with 43 additions and 46 deletions

View File

@@ -1,7 +1,7 @@
import { Column, CreateDateColumn, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import type { Relation } from 'typeorm';
import { Category } from './Category.js';
import { Expense } from './Expense.js';
import { dateTimeColumnType } from '../utils/db-column-types.js';
export type UserRole = 'ADMIN' | 'USER';
@@ -47,12 +47,12 @@ export class User {
defaultListId?: string | null;
} | null;
@CreateDateColumn({ type: 'datetime' })
@CreateDateColumn({ type: dateTimeColumnType })
createdAt!: Date;
@OneToMany(() => Category, (category) => category.user)
categories!: Relation<Category[]>;
categories!: Category[];
@OneToMany(() => Expense, (expense) => expense.user)
expenses!: Relation<Expense[]>;
expenses!: Expense[];
}