-
Notifications
You must be signed in to change notification settings - Fork 9
created the hooks for getting sponsors, sponsor-tasks, deleting a spo… #3386
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
created the hooks for getting sponsors, sponsor-tasks, deleting a spo… #3386
Conversation
…nsor and editing a sponsor-tier
src/frontend/src/apis/finance.api.ts
Outdated
| */ | ||
| export const getAllOtherProductReason = () => { | ||
| return axios.get<OtherProductReason[]>(apiUrls.getAllOtherProductReasons(), { | ||
| transformResponse: (data) => JSON.parse(data) as OtherProductReason[] |
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.
i know you didn't do this but can you remove the as OtherProductReason[], I think its redundant 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.
same with as IndexCode above
src/frontend/src/apis/finance.api.ts
Outdated
| * @returns the list of tasks for a given sponsor | ||
| */ | ||
|
|
||
| export const getsponsorTasks = (sponsorId: string) => { |
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.
should be 'getSponsorTasks'
src/frontend/src/apis/finance.api.ts
Outdated
| * | ||
| * @returns the edited sponosor tier | ||
| */ | ||
| export const editSponsorTier = (sponsorTierId: string, sponsorTierData: EditSponsorTierPayload) => { |
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.
we don't have this endpoint, it should be calling an api to editSponsorTask. That is totally my bad, i miswrote the ticket. Should be a quick change tho
dreifusjack
left a comment
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.
Looks great! Just a few quick fixes. Sorry about the typo in your ticket
src/frontend/src/utils/urls.ts
Outdated
| const getAllOtherProductReasons = () => `${financeEndpoints()}/other-reimbursement-product-reasons`; | ||
| const financeRoutesEndpoints = () => `${API_URL}/finance`; | ||
| const getAllSponsors = () => `${financeRoutesEndpoints()}/sponsors`; | ||
| const getSponsorTasks = (sponsorId: string) => `${financeRoutesEndpoints()}/sponsors/${sponsorId}/tasks`; |
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.
route should end with '/sponsorTasks'
2d21f28 to
dbeedf7
Compare
dreifusjack
left a comment
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
…nsor and editing a sponsor-tier
Changes
made the api's for getting sponsors, sponsor tasks, deleting a sponsor, and editing a sponsor tier. Also made the hooks for each corresponding API.
Notes
Test Cases
Screenshots
To Do
Any remaining things that need to get done
Checklist
It can be helpful to check the
ChecksandFiles changedtabs.Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.
yarn.lockchanges (unless dependencies have changed)Closes #3376