Skip to content
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

Merged
merged 20 commits into from
Jun 7, 2022
Merged

Typescript #1294

merged 20 commits into from
Jun 7, 2022

Conversation

ericenns
Copy link
Member

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, use Fixes #issuenum to automatically close the issue.

Checklist

Things for the developer to confirm they've done before the PR should be accepted:

  • CHANGELOG.md (and UPGRADING.md if necessary) updated with information for new change.
  • Tests added (or description of how to test) for any new features.
  • User documentation updated for UI or technical changes.

@ericenns ericenns requested a review from joshsadam May 31, 2022 19:53
@ericenns ericenns marked this pull request as ready for review May 31, 2022 19:54
Copy link
Contributor

@joshsadam joshsadam left a 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 {
Copy link
Contributor

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}`)
Copy link
Contributor

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>()

@joshsadam joshsadam merged commit ce20611 into development Jun 7, 2022
@joshsadam joshsadam deleted the typescript branch June 7, 2022 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants