Skip to content

Commit

Permalink
addressed comments
Browse files Browse the repository at this point in the history
Signed-off-by: sumukhswamy <[email protected]>
  • Loading branch information
sumukhswamy committed Sep 4, 2024
1 parent fe67bf6 commit 99c0d30
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions public/components/notebooks/components/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,21 @@ export class Main extends React.Component<MainProps, MainState> {
.catch((err) => {
console.error('Issue in fetching the notebooks', err.body.message);
});
} else {
// If `MDS` is not enabled /savedNotebook/ API returns notebooks stored as saved objects, and the other one returns notebooks stored as observability objects.
return Promise.all([
this.props.http.get(`${NOTEBOOKS_API_PREFIX}/savedNotebook/`),
this.props.http.get(`${NOTEBOOKS_API_PREFIX}/`),
])
.then(([savedNotebooksResponse, secondResponse]) => {
const combinedData = {
data: [...savedNotebooksResponse.data, ...secondResponse.data],
};
this.setState(combinedData);
})
.catch((err) => {
console.error('Issue in fetching the notebooks', err.body.message);
});
}
// If `MDS` is not enabled /savedNotebook/ API returns notebooks stored as saved objects, and the other one returns notebooks stored as observability objects.
return Promise.all([
this.props.http.get(`${NOTEBOOKS_API_PREFIX}/savedNotebook/`),
this.props.http.get(`${NOTEBOOKS_API_PREFIX}/`),
])
.then(([savedNotebooksResponse, secondResponse]) => {
const combinedData = {
data: [...savedNotebooksResponse.data, ...secondResponse.data],
};
this.setState(combinedData);
})
.catch((err) => {
console.error('Issue in fetching the notebooks', err.body.message);
});
};

// Creates a new notebook
Expand Down

0 comments on commit 99c0d30

Please sign in to comment.