fix: bug in thre login process
This commit is contained in:
@@ -4,9 +4,11 @@ import { ApiOperation } from "@nestjs/swagger";
|
||||
import { SearchCitiesDto } from "./DTO/cities-search-query.dto";
|
||||
import { SearchProvincesDto } from "./DTO/provinces-search-query.dto";
|
||||
import { AddressService } from "./providers/address.service";
|
||||
import { AuthGuards } from "../../common/decorators/auth-guard.decorator";
|
||||
import { ParamNumberIdDto } from "../../common/DTO/param.dto";
|
||||
|
||||
@Controller("address")
|
||||
@AuthGuards()
|
||||
export class AddressController {
|
||||
constructor(private readonly addressService: AddressService) {}
|
||||
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
import { Column, Entity, ManyToOne, OneToOne } from "typeorm";
|
||||
import { Column, Entity, ManyToOne } from "typeorm";
|
||||
|
||||
import { City } from "./city.entity";
|
||||
import { BaseEntity } from "../../../common/entities/base.entity";
|
||||
import { User } from "../../users/entities/user.entity";
|
||||
|
||||
@Entity()
|
||||
export class Address extends BaseEntity {
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
address: string;
|
||||
|
||||
@Column({ type: "varchar", length: 10, nullable: true })
|
||||
postalCode: string;
|
||||
|
||||
@ManyToOne(() => City, (city) => city.addresses, { nullable: false })
|
||||
@ManyToOne(() => City, { eager: true, onDelete: "SET NULL" })
|
||||
city: City;
|
||||
|
||||
@OneToOne(() => User, (user) => user.address, { onDelete: "CASCADE" })
|
||||
user: User;
|
||||
@Column({ type: "varchar", length: 150 })
|
||||
postalCode: string;
|
||||
|
||||
@Column({ type: "text" })
|
||||
address: string;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
||||
|
||||
import { Address } from "./address.entity";
|
||||
import { Province } from "./province.entity";
|
||||
|
||||
@Entity()
|
||||
@@ -11,9 +10,6 @@ export class City {
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
name: string;
|
||||
|
||||
@OneToMany(() => Address, (address) => address.city)
|
||||
addresses: Address[];
|
||||
|
||||
@ManyToOne(() => Province, (province) => province.cities, { nullable: false })
|
||||
province: Province;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user