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

fix(headless): headless service fetchNotifications should accept archived filter #7136

Open
wants to merge 7 commits into
base: next
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export class GetInAppNotificationsFeedForSubscriberDto extends PaginationRequest
@ApiPropertyOptional({ required: false, type: Boolean })
read: boolean;

@ApiPropertyOptional({ required: false, type: Boolean })
archived: boolean;

@ApiPropertyOptional({ required: false, type: Boolean })
seen: boolean;

Expand Down
1 change: 1 addition & 0 deletions apps/api/src/app/widgets/queries/store.query.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export class StoreQuery {
seen?: boolean;
read?: boolean;
archived?: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ export class GetNotificationsFeed {
command.environmentId,
subscriber._id,
ChannelTypeEnum.IN_APP,
{ feedId: command.feedId, seen: command.query.seen, read: command.query.read, payload },
{
feedId: command.feedId,
seen: command.query.seen,
read: command.query.read,
archived: command.query.archived,
payload,
},
{
limit: command.limit,
skip: command.page * command.limit,
Expand Down
2 changes: 1 addition & 1 deletion libs/dal/src/repositories/message/message.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class MessageRepository extends BaseRepository<MessageDBModel, MessageEnt
environmentId: string,
subscriberId: string,
channel: ChannelTypeEnum,
query: { feedId?: string[]; seen?: boolean; read?: boolean; payload?: object } = {},
query: { feedId?: string[]; seen?: boolean; read?: boolean; archived?: boolean; payload?: object } = {},
options: { limit: number; skip?: number } = { limit: 10 }
) {
const requestQuery = await this.getFilterQueryForMessage(environmentId, subscriberId, channel, query);
Expand Down
1 change: 1 addition & 0 deletions packages/client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface IStoreQuery {
feedIdentifier?: string | string[];
seen?: boolean;
read?: boolean;
archived?: boolean;
limit?: number;
payload?: Record<string, unknown>;
}
Expand Down
Loading