chore (backend): wrap relations in TypeORM Relation<...>

This commit is contained in:
naskya 2024-05-07 21:05:25 +09:00
parent 3ceaf99df6
commit 5daeaf1de2
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C

View file

@ -5,6 +5,7 @@ import {
ManyToOne, ManyToOne,
PrimaryColumn, PrimaryColumn,
Index, Index,
type Relation,
} from "typeorm"; } from "typeorm";
import { Note } from "./note.js"; import { Note } from "./note.js";
import { id } from "../id.js"; import { id } from "../id.js";
@ -34,11 +35,12 @@ export class ScheduledNoteCreation {
onDelete: "CASCADE", onDelete: "CASCADE",
}) })
@JoinColumn() @JoinColumn()
public note: Note; public note: Relation<Note>;
@ManyToOne(() => User, { @ManyToOne(() => User, {
onDelete: "CASCADE", onDelete: "CASCADE",
}) })
@JoinColumn() @JoinColumn()
public user: User; public user: Relation<User>;
//#endregion //#endregion
} }