Mohammed AL Sarraj commited on
Commit
e30e13c
·
1 Parent(s): aa5208c

fix: use relative API URLs so fetch works under blueprint prefix

Browse files
app/tools/changelog_ai/templates/changelog_ai/index.html CHANGED
@@ -309,7 +309,7 @@ refactor: clean up legacy charting utility"></textarea>
309
  btnDownloadPdf.classList.add('hidden');
310
 
311
  try {
312
- const res = await fetch('/api/generate', {
313
  method: 'POST',
314
  headers: { 'Content-Type': 'application/json', 'X-CSRFToken': CSRF },
315
  body: JSON.stringify({
 
309
  btnDownloadPdf.classList.add('hidden');
310
 
311
  try {
312
+ const res = await fetch('api/generate', {
313
  method: 'POST',
314
  headers: { 'Content-Type': 'application/json', 'X-CSRFToken': CSRF },
315
  body: JSON.stringify({
app/tools/git_narrator/templates/git_narrator/index.html CHANGED
@@ -218,7 +218,7 @@ async function doNarrate() {
218
  }, 1400);
219
 
220
  try {
221
- const res = await fetch('/api/narrate', {
222
  method: 'POST',
223
  headers: {'Content-Type':'application/json','X-CSRFToken':_csrf},
224
  body: JSON.stringify({content: raw})
 
218
  }, 1400);
219
 
220
  try {
221
+ const res = await fetch('api/narrate', {
222
  method: 'POST',
223
  headers: {'Content-Type':'application/json','X-CSRFToken':_csrf},
224
  body: JSON.stringify({content: raw})
app/tools/schema_detective/templates/schema_detective/index.html CHANGED
@@ -341,7 +341,7 @@ CREATE TABLE prescriptions (
341
  setAiStatus('working');
342
 
343
  try {
344
- const res = await fetch('/api/analyze', {
345
  method: 'POST',
346
  headers: { 'Content-Type': 'application/json', 'X-CSRFToken': CSRF },
347
  body: JSON.stringify({ schema })
@@ -497,7 +497,7 @@ CREATE TABLE prescriptions (
497
  fixLabel.textContent = 'Generating fixes...';
498
  setAiStatus('working');
499
  try {
500
- const res = await fetch('/api/fix', {
501
  method: 'POST',
502
  headers: { 'Content-Type': 'application/json', 'X-CSRFToken': CSRF },
503
  body: JSON.stringify({ schema, findings: _lastFindings }),
 
341
  setAiStatus('working');
342
 
343
  try {
344
+ const res = await fetch('api/analyze', {
345
  method: 'POST',
346
  headers: { 'Content-Type': 'application/json', 'X-CSRFToken': CSRF },
347
  body: JSON.stringify({ schema })
 
497
  fixLabel.textContent = 'Generating fixes...';
498
  setAiStatus('working');
499
  try {
500
+ const res = await fetch('api/fix', {
501
  method: 'POST',
502
  headers: { 'Content-Type': 'application/json', 'X-CSRFToken': CSRF },
503
  body: JSON.stringify({ schema, findings: _lastFindings }),
app/tools/sql_whisperer/templates/sql_whisperer/index.html CHANGED
@@ -234,7 +234,7 @@ async function generateSQL() {
234
  }, 1200);
235
 
236
  try {
237
- const res = await fetch('/api/whisper', {
238
  method: 'POST',
239
  headers: {'Content-Type': 'application/json', 'X-CSRFToken': _csrf},
240
  body: JSON.stringify({question, schema, dialect})
 
234
  }, 1200);
235
 
236
  try {
237
+ const res = await fetch('api/whisper', {
238
  method: 'POST',
239
  headers: {'Content-Type': 'application/json', 'X-CSRFToken': _csrf},
240
  body: JSON.stringify({question, schema, dialect})
app/tools/test_forge/templates/test_forge/index.html CHANGED
@@ -298,7 +298,7 @@
298
  setAiStatus('working');
299
 
300
  try {
301
- const res = await fetch('/api/generate', {
302
  method: 'POST',
303
  headers: { 'Content-Type': 'application/json', 'X-CSRFToken': CSRF },
304
  body: JSON.stringify({
 
298
  setAiStatus('working');
299
 
300
  try {
301
+ const res = await fetch('api/generate', {
302
  method: 'POST',
303
  headers: { 'Content-Type': 'application/json', 'X-CSRFToken': CSRF },
304
  body: JSON.stringify({