TASK22269: add signed request client and migrate portal deleteWatchedCases pilot
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import { requestJson } from "./endpointClient";
|
||||
import { buildHashedQueryUrl } from "./relayClient";
|
||||
|
||||
const signedRequestJson = async ({ method, queryUrl, data, config = {} }) => {
|
||||
const signedUrl = await buildHashedQueryUrl(queryUrl);
|
||||
|
||||
return requestJson({
|
||||
method,
|
||||
url: signedUrl,
|
||||
data,
|
||||
...config
|
||||
});
|
||||
};
|
||||
|
||||
export const getSignedJson = (queryUrl, config = {}) => {
|
||||
return signedRequestJson({
|
||||
method: "get",
|
||||
queryUrl,
|
||||
config
|
||||
});
|
||||
};
|
||||
|
||||
export const postSignedJson = (queryUrl, data, config = {}) => {
|
||||
return signedRequestJson({
|
||||
method: "post",
|
||||
queryUrl,
|
||||
data,
|
||||
config
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteSignedJson = (queryUrl, config = {}) => {
|
||||
return signedRequestJson({
|
||||
method: "delete",
|
||||
queryUrl,
|
||||
config
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user