Answer the question
In order to leave comments, you need to log in
How to add a helper method to TypeORM?
Tell me how to correctly specify the methods
import { Column, Entity } from "typeorm";
@Entity("users")
export class User extends Template {
@Column({ name: 'firstname', nullable: true })
firstName: string
@Column({ name: 'lastname', nullable: true })
lastName: string
public get fullName(): string {
return `${this.firstName} ${this.lastName}`
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question