Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
@@ -18,7 +18,8 @@ const uploadFile = async (file) => {
|
|
18 |
headers: formData.getHeaders(),
|
19 |
maxBodyLength: Infinity,
|
20 |
});
|
21 |
-
|
|
|
22 |
return response.data || {};
|
23 |
} catch (error) {
|
24 |
console.error('Error uploading file', error.response?.data || error.message);
|
@@ -31,7 +32,6 @@ const patchScreenshot = (page, images) => {
|
|
31 |
page.screenshot = async function (options = {}) {
|
32 |
const buffer = await orig.apply(this, [options]);
|
33 |
const url = await uploadFile(buffer);
|
34 |
-
console.log("[patchScreenshot] Upload result:", url);
|
35 |
if (url && url.path) {
|
36 |
images.push(url.path);
|
37 |
}
|
|
|
18 |
headers: formData.getHeaders(),
|
19 |
maxBodyLength: Infinity,
|
20 |
});
|
21 |
+
console.log("[patchScreenshot] Upload result:", response.data);
|
22 |
+
|
23 |
return response.data || {};
|
24 |
} catch (error) {
|
25 |
console.error('Error uploading file', error.response?.data || error.message);
|
|
|
32 |
page.screenshot = async function (options = {}) {
|
33 |
const buffer = await orig.apply(this, [options]);
|
34 |
const url = await uploadFile(buffer);
|
|
|
35 |
if (url && url.path) {
|
36 |
images.push(url.path);
|
37 |
}
|