-
Notifications
You must be signed in to change notification settings - Fork 77
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/project list page updations #281
Conversation
Current Code Coverage Percent of this PR:97.79 %Files having coverage below 100%
|
|
||
useEffect(() => { | ||
const getClientList = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why write a function for this?
Also code should be
await projectApi.get() .then(res => {// set state}) .catch(e => {//error handling}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajinkyaa Why use .then
and .catch
with await
?
We should not be using .then
and .catch
with async/await
. It defeats the whole purpose of having async/await
in the first place.
We should write it like this:
const fetchClients = async () => {
try {
const data = await projectApi.get();
// state updates
} catch {
// handle errors
}
}
cc// @Shruti-Apte
}).then(() => { | ||
setEditProjectData(""); | ||
setShowProjectModal(false); | ||
window.location.reload(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why reload the window?
Please send another PR |
Okay! with loom video you mean? |
Notion card
https://www.notion.so/saeloun/Remaining-work-on-Project-list-page-refactoring-22ad94893d14411d8e565160c38a40c8
Summary
API integration for project list page
Preview
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Checklist: