Untitled
unknown
plain_text
a year ago
483 B
5
Indexable
class UserSpaces(Resource): def get(self, user_id): # Query to get all spaces associated with the tenant (user_id) spaces = Space.query.filter_by(tenant_id=user_id).all() if spaces: # Convert each space to a dictionary format spaces_list = [space.to_dict() for space in spaces] return jsonify({"spaces": spaces_list}) else: return jsonify({"message": "No spaces found for this user"}), 404
Editor is loading...
Leave a Comment