fix jsp pein de truc en vrais
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { Form, Input, InputNumber, Button, Select } from "antd";
|
||||
import { Form, Input, InputNumber, Button, Select, DatePicker } from "antd";
|
||||
import axios from "axios";
|
||||
|
||||
const { TextArea } = Input;
|
||||
const { Option } = Select;
|
||||
const dateFormat = "YYYY-MM-DD";
|
||||
|
||||
export const FormCreateItem = () => {
|
||||
export const FormCreateItem = ({ onClose }) => {
|
||||
const [form] = Form.useForm();
|
||||
const [rooms, setRooms] = useState([]);
|
||||
|
||||
@@ -31,6 +32,8 @@ export const FormCreateItem = () => {
|
||||
values,
|
||||
);
|
||||
console.log(response.data);
|
||||
// Fermer la fenêtre modale après soumission réussie
|
||||
onClose();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
@@ -58,7 +61,7 @@ export const FormCreateItem = () => {
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
<Form.Item label="Purchase Date" name="purchaseDate">
|
||||
<Input />
|
||||
<DatePicker format={dateFormat} />
|
||||
</Form.Item>
|
||||
<Form.Item label="Description" name="description">
|
||||
<TextArea rows={4} />
|
||||
|
Reference in New Issue
Block a user