Can't see the ID of the hotel table in adminjs

105 Views Asked by At

I have 2 fields which are named hotel and hotel description. In admin page when I add the hotel ID to hotel description image 1. But in the hotel description table on the admin page, the id is not visible image 2.

Here is typeorm entities for them. Hotel.entity

@Entity()
export class Hotel extends BaseEntity {
    @PrimaryGeneratedColumn("uuid")
    id: string;

    @Column({ unique: true, nullable: true })
    hotelName: string;

    @OneToMany(
        () => HotelDescription,
        (hotelDescription) => hotelDescription.hotel,
    )
    hotelDescriptions: HotelDescription[];

    @OneToMany(() => Reservation, (reservation) => reservation.hotel)
    reservations: Reservation[];
}

HotelDescription.entity

@Entity()
export class HotelDescription extends BaseEntity {
    @PrimaryGeneratedColumn("uuid")
    id: string;

    @Column({ type: "text", enum: Language, nullable: true })
    language: Language;

    @Column()
    name: string;

    @Column()
    description: string;

    @OneToOne(() => Service, (service) => service.hotelDescription)
    services: Service;

    @OneToMany(() => Treatment, (treatment) => treatment.hotelDescription)
    treatments: Treatment[];

    @ManyToOne(() => Hotel, (hotel) => hotel.hotelDescriptions)
    hotel: Hotel;
}

I tried to @JoinColumn to try to add hotelId to the entity but that failed (removed in the code above)

0

There are 0 best solutions below