Spaces:
Sleeping
Sleeping
Update static/js/script.js
Browse files- static/js/script.js +5 -5
static/js/script.js
CHANGED
@@ -65,7 +65,7 @@ $(document).ready(function() {
|
|
65 |
startCamera(cameraSelect.value);
|
66 |
});
|
67 |
|
68 |
-
// Upload to
|
69 |
$('#uploadButton').click(function() {
|
70 |
if (!currentImageUrl) {
|
71 |
alert('No image to upload.');
|
@@ -73,20 +73,20 @@ $(document).ready(function() {
|
|
73 |
}
|
74 |
$.ajax({
|
75 |
type: 'POST',
|
76 |
-
url: '/
|
77 |
data: { image_url: currentImageUrl },
|
78 |
success: function(response) {
|
79 |
if (response.status === 'success') {
|
80 |
-
alert('Image
|
81 |
actionButtons.style.display = 'none';
|
82 |
capturedImage.style.display = 'none';
|
83 |
hfResult.textContent = '';
|
84 |
} else {
|
85 |
-
alert('Error
|
86 |
}
|
87 |
},
|
88 |
error: function() {
|
89 |
-
alert('Failed to
|
90 |
}
|
91 |
});
|
92 |
});
|
|
|
65 |
startCamera(cameraSelect.value);
|
66 |
});
|
67 |
|
68 |
+
// Upload to Zapier
|
69 |
$('#uploadButton').click(function() {
|
70 |
if (!currentImageUrl) {
|
71 |
alert('No image to upload.');
|
|
|
73 |
}
|
74 |
$.ajax({
|
75 |
type: 'POST',
|
76 |
+
url: '/upload_zapier',
|
77 |
data: { image_url: currentImageUrl },
|
78 |
success: function(response) {
|
79 |
if (response.status === 'success') {
|
80 |
+
alert('Image sent to Zapier successfully!');
|
81 |
actionButtons.style.display = 'none';
|
82 |
capturedImage.style.display = 'none';
|
83 |
hfResult.textContent = '';
|
84 |
} else {
|
85 |
+
alert('Error sending to Zapier: ' + response.message);
|
86 |
}
|
87 |
},
|
88 |
error: function() {
|
89 |
+
alert('Failed to send image to Zapier.');
|
90 |
}
|
91 |
});
|
92 |
});
|