IO-766 Import job from disk scan.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { DownloadOutlined, SyncOutlined } from "@ant-design/icons";
|
||||
import { Button, Input, Space, Table } from "antd";
|
||||
import { Button, Input, notification, Space, Table } from "antd";
|
||||
import axios from "axios";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -16,7 +16,7 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
});
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(JobsAvailableScan);
|
||||
|
||||
export function JobsAvailableScan({ partnerVersion }) {
|
||||
export function JobsAvailableScan({ partnerVersion, refetch }) {
|
||||
const [estimatesOnDisk, setEstimatesOnDisk] = useState([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [searchText, setSearchText] = useState("");
|
||||
@@ -35,7 +35,12 @@ export function JobsAvailableScan({ partnerVersion }) {
|
||||
const response = await axios.post("http://localhost:1337/import/", {
|
||||
filepath,
|
||||
});
|
||||
console.log("response", response);
|
||||
if (response.data.success) {
|
||||
//Came through
|
||||
if(refetch) refetch()
|
||||
} else {
|
||||
notification["error"]({ message: t("jobs.errors.scanimport", {message: response.data.error}) });
|
||||
}
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user