mirror of
https://github.com/ae-utbm/sith.git
synced 2026-03-13 15:15:03 +00:00
feat: API route to get user memberships
This commit is contained in:
@@ -40,6 +40,8 @@ class ClubProfileSchema(ModelSchema):
|
||||
|
||||
|
||||
class ClubMemberSchema(ModelSchema):
|
||||
"""A schema to represent all memberships in a club."""
|
||||
|
||||
class Meta:
|
||||
model = Membership
|
||||
fields = ["start_date", "end_date", "role", "description"]
|
||||
@@ -53,3 +55,13 @@ class ClubSchema(ModelSchema):
|
||||
fields = ["id", "name", "logo", "is_active", "short_description", "address"]
|
||||
|
||||
members: list[ClubMemberSchema]
|
||||
|
||||
|
||||
class UserMembershipSchema(ModelSchema):
|
||||
"""A schema to represent the active club memberships of a user."""
|
||||
|
||||
class Meta:
|
||||
model = Membership
|
||||
fields = ["id", "start_date", "role", "description"]
|
||||
|
||||
club: SimpleClubSchema
|
||||
|
||||
Reference in New Issue
Block a user