Skip to content

Commit 2204746

Browse files
committed
fix local - global task_id_counter
1 parent a8af014 commit 2204746

File tree

1 file changed

+1
-0
lines changed
  • simple_backend/src/task_tracker

1 file changed

+1
-0
lines changed

simple_backend/src/task_tracker/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def get_tasks():
1111
# We add a new task, add it to the task list, and increment the id counter.
1212
@app.post("/tasks")
1313
def create_task(name: str, condition: str = 'new'):
14+
global task_id_counter
1415
task = {'id': task_id_counter, 'name': name, 'condition': condition}
1516
tasks.append(task)
1617
task_id_counter += 1

0 commit comments

Comments
 (0)