Spaces:
Sleeping
Sleeping
Tristan Yu commited on
Commit ·
8ea155b
1
Parent(s): 602de9e
Fix remaining API calls - add /api prefix to delete, put, and vote endpoints
Browse files
client/src/pages/TutorialTasks.tsx
CHANGED
|
@@ -388,7 +388,7 @@ const TutorialTasks: React.FC = () => {
|
|
| 388 |
if (!editingSubmission || !editSubmissionText.trim()) return;
|
| 389 |
|
| 390 |
try {
|
| 391 |
-
const response = await api.put(`/submissions/${editingSubmission.id}`, {
|
| 392 |
transcreation: editSubmissionText
|
| 393 |
});
|
| 394 |
|
|
@@ -415,7 +415,7 @@ const TutorialTasks: React.FC = () => {
|
|
| 415 |
|
| 416 |
|
| 417 |
try {
|
| 418 |
-
const response = await api.delete(`/submissions/${submissionId}`);
|
| 419 |
|
| 420 |
if (response.status === 200) {
|
| 421 |
|
|
|
|
| 388 |
if (!editingSubmission || !editSubmissionText.trim()) return;
|
| 389 |
|
| 390 |
try {
|
| 391 |
+
const response = await api.put(`/api/submissions/${editingSubmission.id}`, {
|
| 392 |
transcreation: editSubmissionText
|
| 393 |
});
|
| 394 |
|
|
|
|
| 415 |
|
| 416 |
|
| 417 |
try {
|
| 418 |
+
const response = await api.delete(`/api/submissions/${submissionId}`);
|
| 419 |
|
| 420 |
if (response.status === 200) {
|
| 421 |
|
client/src/pages/VoteResults.tsx
CHANGED
|
@@ -135,7 +135,7 @@ const VoteResults: React.FC = () => {
|
|
| 135 |
|
| 136 |
const body = rank ? { rank } : { cancel: true };
|
| 137 |
|
| 138 |
-
const response = await api.post(`/submissions/${submissionId}/vote`, body);
|
| 139 |
|
| 140 |
if (response.data) {
|
| 141 |
// Refresh the data
|
|
|
|
| 135 |
|
| 136 |
const body = rank ? { rank } : { cancel: true };
|
| 137 |
|
| 138 |
+
const response = await api.post(`/api/submissions/${submissionId}/vote`, body);
|
| 139 |
|
| 140 |
if (response.data) {
|
| 141 |
// Refresh the data
|