-
Notifications
You must be signed in to change notification settings - Fork 2
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
Dev aaron #209
Merged
Dev aaron #209
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b88a5db
new total project change mutation
ayobi 3e959c8
Merge branch 'dev' into dev_aaron
khoroshevskyi 1bc1c31
fixed request body
ayobi d1d4b58
new total project change mutation
ayobi c3e825b
fixed request body
ayobi bca92d0
Merge branch 'dev_aaron' of github.com:pepkit/pephub into dev_aaron
ayobi 1742618
Merge remote-tracking branch 'origin/dev_aaron' into dev_aaron
khoroshevskyi 3010e87
fixed total project change mutation
ayobi 16792ac
Merge remote-tracking branch 'origin/dev_aaron' into dev_aaron
khoroshevskyi 393715c
Fixed updating endpoint
khoroshevskyi a39b655
fixed updating subsamples
ayobi d09eab5
dont send subsamples if they dont exist
nleroy917 0c837c6
issue is fixed
nleroy917 95afe11
about changed to coming soon
khoroshevskyi 2528c52
Merge remote-tracking branch 'origin/dev_aaron' into dev_aaron
khoroshevskyi 9601a46
lint
nleroy917 f00fc50
Merge remote-tracking branch 'refs/remotes/origin/dev_aaron' into dev…
nleroy917 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { useMutation, useQueryClient } from '@tanstack/react-query'; | ||
import { AxiosError } from 'axios'; | ||
import { toast } from 'react-hot-toast'; | ||
|
||
import { Sample } from '../../../types'; | ||
import { editTotalProject } from '../../api/project'; | ||
|
||
interface TotalProjectChangeMutationProps { | ||
config?: string; | ||
samples?: Sample[]; | ||
subsamples?: Sample[]; | ||
} | ||
|
||
export const useTotalProjectChangeMutation = ( | ||
namespace: string, | ||
project: string, | ||
tag: string, | ||
jwt: string, | ||
data: TotalProjectChangeMutationProps, | ||
) => { | ||
const queryClient = useQueryClient(); | ||
|
||
const mutation = useMutation({ | ||
mutationFn: () => editTotalProject(namespace || '', project || '', tag, jwt || '', data), | ||
onSuccess: () => { | ||
queryClient.invalidateQueries([namespace, project, tag]); | ||
toast.success('Successfully updated the project!'); | ||
}, | ||
onError: (error: AxiosError) => { | ||
toast.error(`Failed to update project: ${error}`); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe in the near future, we can add proper error handling |
||
}, | ||
}); | ||
|
||
return mutation; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
? no detail
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.
note sure about this from @khoroshevskyi