init commit
This commit is contained in:
28
remotion/node_modules/@remotion/studio/dist/components/call-api.js
generated
vendored
Normal file
28
remotion/node_modules/@remotion/studio/dist/components/call-api.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.callApi = void 0;
|
||||
const callApi = (endpoint, body, signal) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
fetch(endpoint, {
|
||||
method: 'post',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
signal,
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
.then((res) => res.json())
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
resolve(data.data);
|
||||
}
|
||||
else {
|
||||
reject(new Error(data.error));
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
};
|
||||
exports.callApi = callApi;
|
||||
Reference in New Issue
Block a user