From 262a70dbf331247ce2bcc76903870ec656b85582 Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Mon, 9 Mar 2026 20:55:12 +0000 Subject: [PATCH] refactor(api): rename /upload endpoint Ensures consistency with the other dataset-based endpoints and follows the REST-API rules more cleanly. --- frontend/src/pages/Upload.tsx | 2 +- server/app.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Upload.tsx b/frontend/src/pages/Upload.tsx index 93383dc..0799f9b 100644 --- a/frontend/src/pages/Upload.tsx +++ b/frontend/src/pages/Upload.tsx @@ -40,7 +40,7 @@ const UploadPage = () => { setHasError(false); setReturnMessage(""); - const response = await axios.post(`${API_BASE_URL}/upload`, formData, { + const response = await axios.post(`${API_BASE_URL}/datasets/upload`, formData, { headers: { "Content-Type": "multipart/form-data", }, diff --git a/server/app.py b/server/app.py index 7cbf9d3..eb27e70 100644 --- a/server/app.py +++ b/server/app.py @@ -111,7 +111,7 @@ def get_user_datasets(): current_user = int(get_jwt_identity()) return jsonify(dataset_manager.get_user_datasets(current_user)), 200 -@app.route("/upload", methods=["POST"]) +@app.route("/datasets/upload", methods=["POST"]) @jwt_required() def upload_data(): if "posts" not in request.files or "topics" not in request.files: