This commit is contained in:
2026-02-16 15:18:04 -05:00
parent b538782c09
commit 57379f9605
3 changed files with 95 additions and 4 deletions

4
.vscode/launch.json vendored
View File

@@ -2,7 +2,7 @@
"version": "0.2.0",
"configurations": [
{
"name": "Python: Flask (mac)",
"name": "Python: Flask",
"type": "python",
"request": "launch",
"module": "flask",
@@ -70,7 +70,7 @@
{
"name": "Full Stack (Backend + Frontend)",
"configurations": [
"Python: Flask (mac)",
"Python: Flask",
"Vue: Dev Server",
"Chrome: Launch (Vue App)"
]

View File

@@ -166,7 +166,7 @@ def assign_task_to_child(id):
if task_id not in child.get('tasks', []):
child['tasks'].append(task_id)
child_db.update({'tasks': child['tasks']}, ChildQuery.id == id)
return jsonify({'message': f'Task {task_id} assigned to {child['name']}.'}), 200
return jsonify({'message': f"Task {task_id} assigned to {child.get('name')}."}), 200
# python
@child_api.route('/child/<id>/set-tasks', methods=['PUT'])

View File

@@ -1,3 +1,94 @@
{
"_default": {}
"_default": {
"1": {
"id": "fc2afeac-088c-4e97-99ca-e65f23d0dd0c",
"created_at": 1771273028.7139468,
"updated_at": 1771273028.7139468,
"child_id": "child1",
"entity_id": "task1",
"entity_type": "task",
"custom_value": 20
},
"2": {
"id": "52653f70-f559-4c09-9e47-4da9797f3da4",
"created_at": 1771273028.7145221,
"updated_at": 1771273028.714553,
"child_id": "child2",
"entity_id": "task2",
"entity_type": "task",
"custom_value": 25
},
"3": {
"id": "f0f5c964-8ad3-4f60-b026-df4c2da9ea81",
"created_at": 1771273028.7153149,
"updated_at": 1771273028.7153149,
"child_id": "child3",
"entity_id": "task1",
"entity_type": "task",
"custom_value": 10
},
"4": {
"id": "28c24dfb-1e01-4626-a17f-9015b1b9e922",
"created_at": 1771273028.7153192,
"updated_at": 1771273028.7153192,
"child_id": "child3",
"entity_id": "task2",
"entity_type": "task",
"custom_value": 15
},
"5": {
"id": "2c217e2e-84f4-4bce-bff2-309de086bee0",
"created_at": 1771273028.715322,
"updated_at": 1771273028.715322,
"child_id": "child3",
"entity_id": "reward1",
"entity_type": "reward",
"custom_value": 100
},
"33": {
"id": "05443d57-9105-4b6f-9100-00c9b7354980",
"created_at": 1771273031.756525,
"updated_at": 1771273031.756525,
"child_id": "22706d73-eed0-490d-953f-cae150314e16",
"entity_id": "fe7732d5-bb09-4511-8c03-2d2370b4558f",
"entity_type": "task",
"custom_value": 5
},
"34": {
"id": "07987d91-fe7e-401c-9728-f6167b2c4cf4",
"created_at": 1771273031.75777,
"updated_at": 1771273031.75777,
"child_id": "7217c9c2-e6fa-4a3e-af87-a5bb2c52f868",
"entity_id": "fe7732d5-bb09-4511-8c03-2d2370b4558f",
"entity_type": "task",
"custom_value": 20
},
"35": {
"id": "7c280a7b-b09a-409a-8555-a7d62066f786",
"created_at": 1771273031.860357,
"updated_at": 1771273031.860358,
"child_id": "455ecdd3-16df-47f5-8334-6617474c16c7",
"entity_id": "43cf634b-e315-4b8d-9f80-857b9983e980",
"entity_type": "task",
"custom_value": 0
},
"36": {
"id": "cf7c43a4-f329-4d5c-a393-0c42c64b7580",
"created_at": 1771273031.9640598,
"updated_at": 1771273031.9640598,
"child_id": "455ecdd3-16df-47f5-8334-6617474c16c7",
"entity_id": "deca5081-517a-4606-be4e-93c428dbee9e",
"entity_type": "task",
"custom_value": 10000
},
"37": {
"id": "aebd8e05-221c-4f27-838c-d1099d2e2e6b",
"created_at": 1771273032.067507,
"updated_at": 1771273032.067507,
"child_id": "7be7e8fc-7abb-4084-a85e-2b88a465c1ab",
"entity_id": "f4a76137-47d1-4bf1-b2e0-c62b595b703f",
"entity_type": "reward",
"custom_value": 75
}
}
}