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

feat:implement dynamic request function in commcare #755

Merged
merged 5 commits into from
Oct 2, 2024

Conversation

hunterachieng
Copy link
Contributor

@hunterachieng hunterachieng commented Sep 23, 2024

Summary

Implement a generic request function in commcare

Details

We have many distinct APIs in commcare that can be used to make different requests. Since we cannot implement each separately, we have a generic function that will be used to make different requests.

Issues

#751

Review Checklist

Before merging, the reviewer should check the following items:

  • Does the PR do what it claims to do?
  • If this is a new adaptor, Added the adaptor on marketing website ?
  • Are there any unit tests? Should there be?
  • Is there a changeset associated with this PR? Should there be? Note that
    dev only changes don't need a changeset.

Copy link
Collaborator

@josephjclark josephjclark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and simple, great! Just a couple of little comments

We also need a changeset please! This is a minor release because it adds a new function to the API

method: 'POST',
data: form,
});

return prepareNextState(state, response);
return util.prepareNextState(state, response);
} catch (e) {
throw e.body ?? e;
Copy link
Collaborator

@mtuchi mtuchi Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for self @mtuchi

We should have a unit test for this throw e.body ?? e;

Copy link
Collaborator

@mtuchi mtuchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good @hunterachieng

hunterachieng and others added 5 commits October 1, 2024 14:35
* feat: implement bulk upload for lookup-tables and case-data

Signed-off-by: Hunter Achieng <[email protected]>

* deleted imports not required

Signed-off-by: Hunter Achieng <[email protected]>

* fix: remove lookup-table plural

Signed-off-by: Hunter Achieng <[email protected]>

* reduce example and rename test

Signed-off-by: Hunter Achieng <[email protected]>

* update example

Signed-off-by: Hunter Achieng <[email protected]>

* remove try...catch

Signed-off-by: Hunter Achieng <[email protected]>

* fix bulk description

Signed-off-by: Hunter Achieng <[email protected]>

* implement changeset

Signed-off-by: Hunter Achieng <[email protected]>

* add unit test for bulk

---------

Signed-off-by: Hunter Achieng <[email protected]>
Co-authored-by: Emmanuel Evance <[email protected]>
@mtuchi
Copy link
Collaborator

mtuchi commented Oct 2, 2024

@josephjclark i am merging this PR as it's blocking @hunterachieng , incase there is any feedback we can create an issue and open another PR

@mtuchi mtuchi merged commit 8883c5d into main Oct 2, 2024
2 checks passed
@mtuchi mtuchi deleted the feat/commcare-request branch October 2, 2024 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants