Skip to content

Commit d7d6ba2

Browse files
committed
Rough changes to the Javascript
With these changes, it's possible to navigate down the directory hierarchy. Navigating backwards on the "breadcrumb" line (still) doesn't quite work, but I now believe that my URI change in the API hasn't made anything worse than it was before.
1 parent d00b7e4 commit d7d6ba2

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

dashboard/src/actions/tableOfContentActions.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import * as TYPES from "./types";
22
import API from "../utils/axiosInstance";
33
import { uriTemplate } from "../utils/helper";
4+
import { showToast } from "./toastActions";
5+
import { DANGER } from "assets/constants/toastConstants";
46

57
export const fetchTOC =
68
(param, parent, callForSubData) => async (dispatch, getState) => {
@@ -18,7 +20,8 @@ export const fetchTOC =
1820
});
1921
}
2022
} catch (error) {
21-
return error;
23+
const msg = error.response?.data?.message;
24+
dispatch(showToast(DANGER, msg ? msg : `Error response: ERROR_MSG`));
2225
}
2326
};
2427

dashboard/src/modules/components/TableOfContent/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ const TableOfContent = () => {
195195
? initialBreadcrumb(breadCrumbLabels)
196196
: appGroupingBreadcrumb(false, breadCrumbLabels)
197197
);
198-
const dirPath = param.concat(`${firstHierarchyLevel ? "" : "/"}`, data);
198+
const dirPath = param.concat(firstHierarchyLevel ? "" : "/", data);
199199
setParam(dirPath);
200200
setIsLoading(true);
201201
getSubFolderData(dirPath);
@@ -288,7 +288,7 @@ const TableOfContent = () => {
288288
}
289289
>
290290
<FolderIcon />
291-
{data}
291+
{data.name}
292292
</MenuItem>
293293
);
294294
})}

dashboard/src/reducers/tableOfContentReducer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const TableOfContentReducer = (state = initialState, action = {}) => {
3636
stack: [...state.stack, payload],
3737
searchSpace: payload.files,
3838
tableData: payload.files,
39-
currData: payload,
39+
contentData: payload,
4040
isLoading: false,
4141
};
4242

0 commit comments

Comments
 (0)