Fix: Add missing assignment_type field to chore API response
Fixed get_chore_with_assignments() to include assignment_type in dict. This resolves the ResponseValidationError where assignment_type was missing from API responses despite being present in the database.
This commit is contained in:
@@ -40,6 +40,7 @@ def get_chore_with_assignments(db: Session, chore: Chore) -> dict:
|
|||||||
"id": user.id,
|
"id": user.id,
|
||||||
"username": user.username,
|
"username": user.username,
|
||||||
"full_name": user.full_name,
|
"full_name": user.full_name,
|
||||||
|
"avatar_url": user.avatar_url,
|
||||||
"birthday": user.birthday,
|
"birthday": user.birthday,
|
||||||
"completed_at": assignment.completed_at
|
"completed_at": assignment.completed_at
|
||||||
})
|
})
|
||||||
@@ -52,6 +53,8 @@ def get_chore_with_assignments(db: Session, chore: Chore) -> dict:
|
|||||||
"room": chore.room,
|
"room": chore.room,
|
||||||
"frequency": chore.frequency,
|
"frequency": chore.frequency,
|
||||||
"points": chore.points,
|
"points": chore.points,
|
||||||
|
"image_url": chore.image_url,
|
||||||
|
"assignment_type": chore.assignment_type,
|
||||||
"status": chore.status,
|
"status": chore.status,
|
||||||
"due_date": chore.due_date,
|
"due_date": chore.due_date,
|
||||||
"completed_at": chore.completed_at,
|
"completed_at": chore.completed_at,
|
||||||
|
|||||||
Reference in New Issue
Block a user