Skip to content

Commit

Permalink
fix: modify the notifications serializer and WS url
Browse files Browse the repository at this point in the history
  • Loading branch information
SyedAhkam committed Jul 18, 2023
1 parent e60efee commit 21c1978
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion backend/api_app/monitoring/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

websocket_urlpatterns = [
path(
"ws/notifications/<str:owner_organization_id>/", NotificationsConsumer.as_asgi()
"ws/notifications/<str:owner_organization_id>", NotificationsConsumer.as_asgi()
),
]
16 changes: 10 additions & 6 deletions backend/api_app/monitoring/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,6 @@ def validate_configuration(yaml_data):
return serializer.validated_data


class NotificationAPISerializer(rfs.ModelSerializer):
class Meta:
model = Notification
exclude = ["task_id"]


class AlertsAPISerializer(rfs.ModelSerializer):
class CustomYAMLField(rfs.Field):
@classmethod
Expand Down Expand Up @@ -301,3 +295,13 @@ def send_webhook(self, alert_data):
trigger_transaction_hash=self.transaction.hash,
)
notification.save()

class NotificationAPISerializer(rfs.ModelSerializer):
alert_name = rfs.CharField(source="alert.name")
alert_description = rfs.CharField(source="alert.description")
contract_name = rfs.CharField(source="alert.smart_contract.name")

class Meta:
model = Notification
exclude = ["task_id"]

1 comment on commit 21c1978

@vercel
Copy link

@vercel vercel bot commented on 21c1978 Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

thirdeye-flow – ./frontend

thirdeye-flow-argusoss.vercel.app
thirdeye-flow.vercel.app
thirdeye-flow-git-flow-argusoss.vercel.app

Please sign in to comment.