N
Novu16mo ago
dbousamra

IMessage missing subscriber and actor types.

Hi all. I notice the IMessage type when I am building my own React headless notification center does not match the actual data the API is returning:
{
"cta": {
"action": {
"buttons": []
},
"type": "redirect",
"data": {
"url": "http://localhost:7081/organizations/2b09dbec-879a-4f5b-a422-6fc202a58c73/incidents/b2d12179-327b-43ee-92e1-ac4594e093e7"
}
},
.... A bunch of other unrelated fields
"subscriber": {
"_id": "64fa87317bfe966b0ce62b51",
"firstName": "Team",
"lastName": "Leader",
"subscriberId": "auth0|649a83c638f93cb86b04d904",
"avatar": "https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/1218.jpg",
"id": "64fa87317bfe966b0ce62b51"
},
"actorSubscriber": null,
"id": "64fd5dcff1a5b873e5c1bb99"
}
{
"cta": {
"action": {
"buttons": []
},
"type": "redirect",
"data": {
"url": "http://localhost:7081/organizations/2b09dbec-879a-4f5b-a422-6fc202a58c73/incidents/b2d12179-327b-43ee-92e1-ac4594e093e7"
}
},
.... A bunch of other unrelated fields
"subscriber": {
"_id": "64fa87317bfe966b0ce62b51",
"firstName": "Team",
"lastName": "Leader",
"subscriberId": "auth0|649a83c638f93cb86b04d904",
"avatar": "https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/1218.jpg",
"id": "64fa87317bfe966b0ce62b51"
},
"actorSubscriber": null,
"id": "64fd5dcff1a5b873e5c1bb99"
}
Compare that against what the API says it should return: https://docs.novu.co/notification-center/react/api-reference#the-notification-imessage-model I want to access the subscriber info here, but the typescript types make no mention of it.
React Notification Center API Reference | Novu
This page contains the complete documentation about the React Notification Center package. You can find here the list of all the components, hooks and props that you can use.
4 Replies
Pawan Jain
Pawan Jain16mo ago
Yes I see repsonse schema is different This response is as per IMessageEntity along with some fields population @Engineering What do you think? shall we update this info in doc or I am missing something?
Dima Grossman
Dima Grossman16mo ago
@Pawan Jain I think we should just update the response types to include the populated fields there
Linear
Linear16mo ago
Issue DOCS-2 created.
Pawan Jain
Pawan Jain16mo ago
hi @dbousamra Thanks for reporting We have created an internal ticket, I will keep you posted
Want results from more Discord servers?
Add your server