Skip to content

Commit

Permalink
feat: add flowstart_data
Browse files Browse the repository at this point in the history
  • Loading branch information
helllllllder committed Oct 14, 2024
1 parent e048186 commit 9a91c1d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions chats/apps/api/v1/rooms/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,16 @@ def get_queue(self, room: Room):
def get_tags(self, room: Room):
return []

def get_flowstart_data(self, room: Room):
return {}
def get_flowstart_data(self, room: Room) -> bool:
try:
flowstart = room.flowstarts.get(is_deleted=False)
except (ObjectDoesNotExist, MultipleObjectsReturned):
return {}
return {
"name": flowstart.name,
"is_deleted": flowstart.is_deleted,
"created_on": flowstart.created_on,
}

def get_contact(self, room: Room):
return {
Expand Down

0 comments on commit 9a91c1d

Please sign in to comment.