Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds the triggers field in the flow listing of the flows #140

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion weni/grpc/flow/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,21 @@
from django_grpc_framework import proto_serializers

from temba.flows.models import Flow
from temba.triggers.models import Trigger


class FlowTriggerProtoSerializer(proto_serializers.ModelProtoSerializer):
class Meta:
model = Trigger
proto_class = flow_pb2.Trigger
fields = ("keyword", "trigger_type", "id")


class FlowProtoSerializer(proto_serializers.ModelProtoSerializer):

triggers = FlowTriggerProtoSerializer(many=True, read_only=True)

class Meta:
model = Flow
proto_class = flow_pb2.Flow
fields = ["uuid", "name"]
fields = ["uuid", "name", "triggers"]