br41nslug / directus-websocket-subscribe

An extension to subscribe to directus updates over a websocket.
MIT License
106 stars 13 forks source link

How can i custom payload answer #3

Closed alexdieudonne closed 2 years ago

alexdieudonne commented 2 years ago

Default i receive this

{ "type": "SUBSCRIPTION", "action": "create", "payload": { "id": 1, "test": "test123", }, "key": 1, "collection": "test" }

but i want to show this I want to for example populate some field manually

{ "type": "SUBSCRIPTION", "action": "create", "payload": { "id": { "name":"dqsqs", "email":"al223@gmail.com" }, "test": "test123", }, "key": 1, "collection": "test" }

br41nslug commented 2 years ago

Especially for the update event returning partial results i was missing such a feature myself too! So i finally got around to adding an event for doing such manipulations. More info can be found here :) https://github.com/br41nslug/directus-websocket-subscribe#subscription-filter

alexdieudonne commented 2 years ago

thank you !