I am am using nestjs & typeorm to query
//this is my model(interface)
export interface Product {
id?:number,
name?:string,
}
this is my entity.ts
@Entity('product')
export class ProductEntity{
@PrimaryGeneratedColumn()
id:number;
@Column({ type:'text',nullable:true })
name:string;
@Column({type:'timestamp',default:() => 'CURRENT_TIMESTAMP'})
createdAt:Date;
}
the name column value is Null
This is what I call using postgress,
did anyone know how to fix this?
CodePudding user response:
You are sending a text payload to the backend. It should be a JSON payload.
Use the dropdown menu to select JSON
and the issue will go away.