Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit b92409f

Browse files
#638 - Pass org id to retrieve uploads for the current org
1 parent feb8aa7 commit b92409f

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

client/src/components/Upload/Table/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default function Table({ state, data }) {
2626
minute: "2-digit",
2727
}).format(new Date(date)),
2828
},
29+
createdBy: { name: "Uploader" },
2930
status: { name: "Status" },
3031
info: { name: "Info" },
3132
failedRecordsUrl: {
@@ -84,7 +85,7 @@ export default function Table({ state, data }) {
8485
</thead>
8586
<tbody>
8687
<tr>
87-
<td colSpan="4">No records uploaded in the past 24 hours</td>
88+
<td colSpan="5">No records uploaded in the past 24 hours</td>
8889
</tr>
8990
</tbody>
9091
</table>

client/src/components/Upload/index.jsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import style from "./style.module.scss";
1414
import config from "../../config";
1515
import api from "../../services/api";
1616
import { getSingleOrg } from "../../services/user-org";
17+
import { ConsoleTransportOptions } from "winston/lib/winston/transports";
1718

1819
const UPLOAD_STATES = {
1920
INITIAL: "INITIAL",
@@ -76,7 +77,7 @@ export default function Upload({ templateId }) {
7677
data: {
7778
title: "Profiles uploaded successfully",
7879
message:
79-
"The uploaded profiles are now being processed. This may take some time, depending on the number of profiles. Once processed, you will be able to see the profiles in the search page.",
80+
"The uploaded profiles are now being processed. This may take some time, depending on the number of profiles. Once processed, you will be able to see the profiles in the search page. Refresh this tab to view the status of the upload.",
8081
},
8182
});
8283
} catch (error) {
@@ -91,11 +92,20 @@ export default function Upload({ templateId }) {
9192
setTableState(TABLE_STATES.LOADING_LAST_UPLOADS);
9293

9394
try {
94-
const { data } = await apiClient.get(url);
95+
const { data } = await apiClient.get(url, {
96+
params: {
97+
organizationId: getSingleOrg(),
98+
},
99+
});
95100

96101
setTableState(TABLE_STATES.RESULT);
97102
setLastUploads(data);
98103
} catch (error) {
104+
console.log("An error occurred when fetching uploads");
105+
console.log(error);
106+
alert(
107+
"An error occurred when fetching details about uploads carried out in the past 24 hours"
108+
);
99109
setTableState(TABLE_STATES.RESULT);
100110
setLastUploads([]);
101111
}

0 commit comments

Comments
 (0)