fix: remove request id when calling the sync api #258
Merged
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.
Description
This PR introduces changes to the
restClient
module to handle POST requests to the sync API endpoint differently.Resolves #257
Changes
API_SYNC_BASE_URI
constant from theendpoints
module to make it accessible in other modulesrequest
function inrestClient
to skip generating a random request ID for POST requests to the sync API endpointrestClient.test.ts
to verify that a random request ID is not created for POST requests to the sync API endpointRationale
The sync API endpoint does not allow a request ID in the CORS headers. To accommodate this, the
request
function now checks if thebaseUri
includes theAPI_SYNC_BASE_URI
before generating a random request ID for POST requests. This ensures that POST requests to the sync API endpoint do not include a request ID, while other POST requests continue to generate a random request ID if none is provided.Testing
A new test case has been added to
restClient.test.ts
to verify that a random request ID is not created when making a POST request to the sync API endpoint.Please review the changes and provide any feedback or suggestions.