Skip to content

Commit e7230f3

Browse files
committed
chore(deploy): update API endpoint to deployment AKfycbwLJqlNoilpsu7RBoOv0Cb6L9j3SDl-XAQKUZALyo3Bhspr07Vdq5XCd4fy9BAj1fZCMg
- Updated frontend configuration with new Google Apps Script deployment ID - Updated test script with new endpoint - Updated environment configuration Deployment ID: AKfycbwLJqlNoilpsu7RBoOv0Cb6L9j3SDl-XAQKUZALyo3Bhspr07Vdq5XCd4fy9BAj1fZCMg Endpoint: https://script.google.com/macros/s/AKfycbwLJqlNoilpsu7RBoOv0Cb6L9j3SDl-XAQKUZALyo3Bhspr07Vdq5XCd4fy9BAj1fZCMg/exec
1 parent 3624162 commit e7230f3

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

backend/thinkREDBot.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,4 +291,21 @@ function isValidBase64(str) {
291291
function sanitizeFileName(name) {
292292
// Remove special characters and replace spaces with underscores
293293
return name.replace(/[^a-zA-Z0-9\s]/g, '').replace(/\s+/g, '_').substring(0, 50);
294+
}
295+
296+
function createErrorResponse(message) {
297+
return createCorsResponse({ success: false, error: message });
298+
}
299+
300+
function createCorsResponse(data) {
301+
const output = ContentService.createTextOutput(JSON.stringify(data))
302+
.setMimeType(ContentService.MimeType.JSON);
303+
304+
// Google Apps Script does not support custom headers for CORS
305+
// CORS is automatically handled when the web app is deployed with:
306+
// - Execute as: Me (or User accessing the web app)
307+
// - Who has access: Anyone
308+
// The deployment settings handle CORS automatically
309+
310+
return output;
294311
}

frontend/src/config/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ const getDeploymentId = (): string => {
158158
}
159159

160160
// Final fallback to latest known production deployment ID
161-
return 'AKfycbx1hNttxsfo5_LaXTPRN7XJvktexa8dWd38pu7ADZGY-JUzNG7S0p7rFohF-AWReBkxMg';
161+
return 'AKfycbwLJqlNoilpsu7RBoOv0Cb6L9j3SDl-XAQKUZALyo3Bhspr07Vdq5XCd4fy9BAj1fZCMg';
162162
};
163163

164164
/**

test-cors-api.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
echo "🧪 Testing ThinkRED API CORS Fix"
66
echo "================================="
77

8-
API_ENDPOINT="https://script.google.com/macros/s/AKfycbx1hNttxsfo5_LaXTPRN7XJvktexa8dWd38pu7ADZGY-JUzNG7S0p7rFohF-AWReBkxMg/exec"
8+
API_ENDPOINT="https://script.google.com/macros/s/AKfycbwLJqlNoilpsu7RBoOv0Cb6L9j3SDl-XAQKUZALyo3Bhspr07Vdq5XCd4fy9BAj1fZCMg/exec"
99

1010
echo "📡 Testing API endpoint: $API_ENDPOINT"
1111
echo ""

0 commit comments

Comments
 (0)