Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: display 'no data' if backend returns none in home page #147

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

ErnestaP
Copy link
Contributor

ui/package.json Outdated
@@ -11,6 +11,7 @@
"dependencies": {
"@ant-design/cssinjs": "^1.17.2",
"antd": "^5.10.1",
"lodash": "^4.17.21",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need lodash, I don't see using it in the PR :)

@@ -63,8 +72,9 @@ export const getServerSideProps: GetServerSideProps = async () => {

const res = await fetch(`${getApiUrl() + getSearchUrl(query)}`, authToken);
const { count, facets } = (await res?.json()) as Response;

return { props: { count, facets, query } };
const countValue = { count: count ? count : 0 };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const countValue = { count: count ? count : 0 };
const countValue = { count: count || 0 };


return { props: { count, facets, query } };
const countValue = { count: count ? count : 0 };
const facetsValue = { facets: facets ? facets : null };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@karolina-siemieniuk-morawska karolina-siemieniuk-morawska merged commit 9643d2f into SCOAP3:main Nov 29, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants