-
Notifications
You must be signed in to change notification settings - Fork 0
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
Task/WP-728: Mutation hook: Copy file #1000
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1000 +/- ##
===========================================
+ Coverage 60.44% 72.88% +12.44%
===========================================
Files 211 534 +323
Lines 6285 33456 +27171
Branches 730 2981 +2251
===========================================
+ Hits 3799 24385 +20586
- Misses 2329 8876 +6547
- Partials 157 195 +38
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
This works 100% as intended! Looks good to me!
}); | ||
// Result | ||
const result = copyCalls; | ||
dispatch({ |
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.
This dispatch will occur immediately after copyCalls
is constructed. You might need to use mutateAsync
and await each mutation before dispatching the toast. mutateAsync
returns a promise so you could use Promise.all()
here.
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.
LGTM! The final callback now doesn't fire until all operations are complete.
Overview
Updating hooks to use React Query mutations with Typescript. This mutation covers copying a file.
Related
Changes
Testing
UI