sửa lỗi form không reset, cập nhật thêm hàm gọi api khi thêm mới tàu
This commit is contained in:
@@ -96,6 +96,12 @@ const CreateOrUpdateShip = (props: CreateOrUpdateShipProps) => {
|
||||
}
|
||||
}, [props.isOpen, props.initialValue, reset]);
|
||||
|
||||
useEffect(() => {
|
||||
if (props.type === "create") {
|
||||
reset(props.initialValue);
|
||||
}
|
||||
}, [props.isOpen]);
|
||||
|
||||
// Prepare options for selects
|
||||
const shipTypeOptions = useMemo<SelectOption[]>(() => {
|
||||
return (shipTypes || []).map((type) => ({
|
||||
|
||||
Reference in New Issue
Block a user