Skip to content

Commit fb788c3

Browse files
committed
Resolve Conflicts
1 parent e135f4a commit fb788c3

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

app.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,6 @@ def get_queue_paginated():
289289
except Exception as e:
290290
return jsonify({'error': str(e)}), 500
291291

292-
293-
294-
@app.route("/queue_item", methods=['GET'])
295-
def handleGetQueueItems():
296-
handler = QueueItem()
297-
items = handler.getAllQueueItem()
298-
return jsonify(items), 200
299-
300-
301292

302293
@app.route("/queue_item/<int:queue_id>/order", methods=['PUT'])
303294
@jwt_required()
@@ -309,6 +300,14 @@ def update_item_order(queue_id):
309300

310301

311302

303+
# ————— GET all queue items (public) —————
304+
@app.route("/queue_item", methods=['GET'])
305+
def handleGetQueueItems():
306+
handler = QueueItem()
307+
items = handler.getAllQueueItem()
308+
return jsonify(items), 200
309+
310+
# ————— Create a new queue item (auth required) —————
312311
@app.route("/queue_item", methods=['POST'])
313312
@jwt_required()
314313
def handleCreateQueueItem():
@@ -321,6 +320,7 @@ def handleCreateQueueItem():
321320
'scheduled',
322321
'scheduled_at'
323322
}
323+
324324
if not required_keys.issubset(data):
325325
return jsonify("Missing one of required keys"), 400
326326

@@ -331,6 +331,7 @@ def handleCreateQueueItem():
331331
except Exception as e:
332332
print("Error processing request:", e)
333333
return jsonify("Invalid JSON data provided"), 400
334+
334335
@app.route("/queue_item/<int:queue_id>", methods=['GET', 'PUT', 'DELETE'])
335336
def handleQueueItemById(queue_id):
336337
if request.method == 'GET':
@@ -394,7 +395,7 @@ def handleUploadHistoryById(history_id):
394395
return jsonify("No data provided"), 400
395396

396397
# For partial updates, you might remove this check or adapt it
397-
valid_keys = {'design_id', 'attempt_time', 'file_size', 'status'}
398+
valid_keys = {'design_id', 'attempt_time', 'status'}
398399
if not any(key in data for key in valid_keys):
399400
return jsonify("Missing a key"), 400
400401

0 commit comments

Comments
 (0)