-
Notifications
You must be signed in to change notification settings - Fork 31
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
Typescript #1294
Typescript #1294
Conversation
Co-authored-by: Josh Adam <josh.adam@phac-aspc.gc.ca>
…ssociated projects object after mutations.
… function exports to normal functions.
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.
Freakin' Awesome! Thanks for setting this up.
content: Activity[]; | ||
} | ||
|
||
export interface Activity { |
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 think this would be one of the items that we could bring up to the types' folder
*/ | ||
export function getProjectActivities({ projectId, page = 0 }) { | ||
export function getProjectActivities(projectId: number, page = 0): Promise<Activities> { | ||
try { | ||
return axios | ||
.get(`${BASE_URL}/project?projectId=${projectId}&page=${page}`) |
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.
It seems to be best practice (from a number of examples I looked at) to type the request, so in this case:
return axios.get<ActivitiesResponse>()
Description of changes
Added in support for typescript and converted LoginForm to typescript as an example.
Related issue
Link to the GitHub issue this pull request addresses using the
#issuenum
format. If it completes an issue, useFixes #issuenum
to automatically close the issue.Checklist
Things for the developer to confirm they've done before the PR should be accepted: