<div
style={{
display: "flex",
flexDirection: "column",
justifyContent: "flex-end",
}}
>
<label className="chat-input" htmlFor="messageInput">
<label>
<input
type="file"
accept="image/png , image/jpeg, image/webp"
/>
<i className="icon icon-attachment"></i>
</label>
<textarea
ref={textarea}
onInput={textareaInputHandler}
id="messageInput"
/>
<button type="submit">
<i className="icon icon-send-message"></i>
</button>
</label>
</div>
createOrder {
"title": "Название",
"client": "2ed88999-ca3d-4976-bf3d-9ce1d74b7d63",
"price": "200",
"date_start": "2022-12-11",
"date_end": "2022-12-12",
"comment": "Комментарий",
"status": "new"
}
@Entity()
export class Client {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column()
name: string;
@OneToMany(type => Order, order => order.client)
orders: Order[];
@Column()
phone: number;
@Column()
comment: string;
}
@Entity()
export class Order {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column()
title: string;
@ManyToOne(type => Client)
@JoinColumn()
client: Client;
@Column()
price: number;
@Column()
date_start: Date;
@Column()
date_end: Date;
@Column()
comment: string;
@Column()
status: string;
}
А получения списка с отношениями
async getAll(): Promise<Order[]> {
return this.orderRepository.find({
relations: ["client"]
});
}
msg.data.forEach(el => {console.log(el)})