Skip to content

Commit

Permalink
feat: dashboard tag filter
Browse files Browse the repository at this point in the history
  • Loading branch information
helllllllder committed Oct 16, 2023
1 parent 733c8b8 commit d915117
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions chats/apps/api/v1/dashboard/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def dashboard_general_data(context: dict, project):
rooms_filter["queue__sector"] = context.get("sector")
# rooms_query = Room.objects
if context.get("tag"):
rooms_filter["tags__name"] = context.get("tag")
rooms_filter["tags__uuid"] = context.get("tag")
else:
rooms_filter["queue__sector__project"] = project

Expand Down Expand Up @@ -137,7 +137,7 @@ def dashboard_agents_data(context, project):
if context.get("sector"):
rooms_filter["rooms__queue__sector"] = context.get("sector")
if context.get("tag"):
rooms_filter["rooms__tags__name"] = context.get("tag")
rooms_filter["rooms__tags__uuid"] = context.get("tag")

project_permission_subquery = ProjectPermission.objects.filter(
project_id=project,
Expand Down Expand Up @@ -181,7 +181,7 @@ def dashboard_division_data(context, project=None):
division_level = "room__queue"
rooms_filter["room__queue__sector"] = context.get("sector")
if context.get("tag"):
rooms_filter["room__tags__name"] = context.get("tag")
rooms_filter["room__tags__uuid"] = context.get("tag")
else:
rooms_filter["room__queue__sector__project"] = project
rooms_filter["room__user__isnull"] = False
Expand Down Expand Up @@ -255,7 +255,7 @@ def get_closed_rooms(self, project):
if self.context.get("sector"):
rooms_filter["queue__sector"] = self.context.get("sector")
if self.context.get("tag"):
rooms_filter["tags__name"] = self.context.get("tag")
rooms_filter["tags__uuid"] = self.context.get("tag")
if self.context.get("queue"):
rooms_filter["queue"] = self.context.get("queue")
else:
Expand Down Expand Up @@ -306,7 +306,7 @@ def get_transfer_count(self, project):
if self.context.get("sector"):
rooms_filter["queue__sector"] = self.context.get("sector")
if self.context.get("tag"):
rooms_filter["tags__name"] = self.context.get("tag")
rooms_filter["tags__uuid"] = self.context.get("tag")
else:
rooms_filter["queue__sector__project"] = project

Expand Down

0 comments on commit d915117

Please sign in to comment.