Sigex
NNovu
•Created by Sigex on 12/23/2024 in #💬│support
Headless service `fetchNotifications` should accept 'archived' filter
9 replies
NNovu
•Created by Sigex on 12/23/2024 in #💬│support
Headless service `fetchNotifications` should accept 'archived' filter
Note:
The
IStoreQuery
we use filters using the payload
. Which is not available on the notifications.list which can be accessed via useNovu
. So that one is not suitable. I am aware it does have archived
as a filter.9 replies
NNovu
•Created by Sigex on 12/23/2024 in #💬│support
Headless service `fetchNotifications` should accept 'archived' filter
Heading over to
findBySubscriberChannel
we see;
Now this is where it gets interesting... So far all the way down this Rabit Hole archived
has not been present on the query object.
But... the query object is parsed into getFilterQueryForMessage
which does support archived
.
This getFilterQueryForMessage
is used by getCount
as well which does accept archived
.
So the solution here is to simply pass archived
all the way down.9 replies
NNovu
•Created by Sigex on 12/23/2024 in #💬│support
Headless service `fetchNotifications` should accept 'archived' filter
The main execute for this makes a call to;
9 replies
NNovu
•Created by Sigex on 12/23/2024 in #💬│support
Headless service `fetchNotifications` should accept 'archived' filter
Hi Pawan,
1.Yes. We use the same approach as Midday
https://github.com/midday-ai/midday/blob/main/apps/dashboard/src/hooks/use-notifications.ts
2. Yes. We use
@novu/framework
to define workflow's and we use @novu/framework/next
3. Novu cloud.
---
The query object for the fetchNotifications is of type IStoreQuery
Notice the lack of archived
as one of the allowed filters. The fetchNotifications
for the Headless Service is defined in.
packages/headless/src/lib/headless.service.ts
The heavy work is done by this.api.getNotificationsList(page, query)
That hands off too;
The widgets controller has a Get
method which uses CQRS to execute the following command GetNotificationsFeedCommand
.9 replies
NNovu
•Created by Sigex on 12/23/2024 in #💬│support
Headless service `fetchNotifications` should accept 'archived' filter
@Pawan Jain
9 replies