Spaces:
Sleeping
Sleeping
Mohammed AL Sarraj commited on
Commit ·
3131f8d
1
Parent(s): 3cb165e
fix: use relative API URLs so fetch works under blueprint prefix
Browse files
app/tools/ai_debate_arena/templates/ai_debate_arena/index.html
CHANGED
|
@@ -264,7 +264,7 @@
|
|
| 264 |
btnPdf.classList.add('hidden');
|
| 265 |
|
| 266 |
try {
|
| 267 |
-
const res = await fetch('
|
| 268 |
method: 'POST',
|
| 269 |
headers: { 'Content-Type': 'application/json', 'X-CSRFToken': CSRF },
|
| 270 |
body: JSON.stringify({ proposition, language: langSelect.value })
|
|
|
|
| 264 |
btnPdf.classList.add('hidden');
|
| 265 |
|
| 266 |
try {
|
| 267 |
+
const res = await fetch('api/debate', {
|
| 268 |
method: 'POST',
|
| 269 |
headers: { 'Content-Type': 'application/json', 'X-CSRFToken': CSRF },
|
| 270 |
body: JSON.stringify({ proposition, language: langSelect.value })
|
app/tools/content_repurposer/templates/content_repurposer/index.html
CHANGED
|
@@ -271,7 +271,7 @@ function updateCharCount() {
|
|
| 271 |
fd.append('file', file);
|
| 272 |
|
| 273 |
try {
|
| 274 |
-
const res = await fetch('
|
| 275 |
method: 'POST',
|
| 276 |
headers: { 'X-CSRFToken': _csrf },
|
| 277 |
body: fd,
|
|
@@ -316,7 +316,7 @@ async function repurpose() {
|
|
| 316 |
}, 1400);
|
| 317 |
|
| 318 |
try {
|
| 319 |
-
const res = await fetch('
|
| 320 |
method: 'POST',
|
| 321 |
headers: {'Content-Type': 'application/json', 'X-CSRFToken': _csrf},
|
| 322 |
body: JSON.stringify({
|
|
@@ -424,7 +424,7 @@ function renderResults(results) {
|
|
| 424 |
}
|
| 425 |
|
| 426 |
async function downloadResult(fmt, text) {
|
| 427 |
-
const res = await fetch('
|
| 428 |
method: 'POST',
|
| 429 |
headers: {'Content-Type': 'application/json', 'X-CSRFToken': _csrf},
|
| 430 |
body: JSON.stringify({format: fmt, text})
|
|
|
|
| 271 |
fd.append('file', file);
|
| 272 |
|
| 273 |
try {
|
| 274 |
+
const res = await fetch('api/upload', {
|
| 275 |
method: 'POST',
|
| 276 |
headers: { 'X-CSRFToken': _csrf },
|
| 277 |
body: fd,
|
|
|
|
| 316 |
}, 1400);
|
| 317 |
|
| 318 |
try {
|
| 319 |
+
const res = await fetch('api/repurpose', {
|
| 320 |
method: 'POST',
|
| 321 |
headers: {'Content-Type': 'application/json', 'X-CSRFToken': _csrf},
|
| 322 |
body: JSON.stringify({
|
|
|
|
| 424 |
}
|
| 425 |
|
| 426 |
async function downloadResult(fmt, text) {
|
| 427 |
+
const res = await fetch('api/download', {
|
| 428 |
method: 'POST',
|
| 429 |
headers: {'Content-Type': 'application/json', 'X-CSRFToken': _csrf},
|
| 430 |
body: JSON.stringify({format: fmt, text})
|