refactor(actions): extract fileClient with phase22 coverage
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { getJson, requestJson } from "./endpointClient";
|
||||
import { buildHashedQueryUrl } from "./relayClient";
|
||||
|
||||
export const getFileJson = (url) => {
|
||||
return getJson(url);
|
||||
};
|
||||
|
||||
export const getSignedFileJson = async (queryUrl) => {
|
||||
const signedUrl = await buildHashedQueryUrl(queryUrl);
|
||||
|
||||
return requestJson({
|
||||
method: "get",
|
||||
url: signedUrl
|
||||
});
|
||||
};
|
||||
|
||||
export const downloadFileBlob = (url) => {
|
||||
return requestJson({
|
||||
method: "get",
|
||||
url,
|
||||
responseType: "blob"
|
||||
});
|
||||
};
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from "./relayClient";
|
||||
export * from "./endpointClient";
|
||||
export * from "./fileClient";
|
||||
|
||||
Reference in New Issue
Block a user