
--- action.py
+++ action.py
... | ... | @@ -55,10 +55,15 @@ |
55 | 55 |
@Action.doc(responses={200: 'Success'}) |
56 | 56 |
@Action.doc(responses={500: 'Register Failed'}) |
57 | 57 |
def post(self): |
58 |
- # Extracting JSON data |
|
58 |
+ |
|
59 |
+ uploaded_file = request.files.get('file') |
|
60 |
+ if not uploaded_file: |
|
61 |
+ return {"message": "No file uploaded"}, 400 |
|
62 |
+ |
|
59 | 63 |
json_data = request.form.get('data') |
60 | 64 |
if not json_data: |
61 |
- return jsonify({"message": "Missing JSON data"}), 400 |
|
65 |
+ return {"message": "Missing JSON data"}, 400 |
|
66 |
+ |
|
62 | 67 |
data = json.loads(json_data) |
63 | 68 |
|
64 | 69 |
lat = float(data['gps_x']) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?