Skip to content

Commit

Permalink
chore(feedback-service): added new filters for listFeedbacks query (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
riginoommen committed Feb 27, 2023
2 parents e469e00 + 05bc19c commit 2e808a8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/feedback-service/src/feedbacks/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,19 @@ const FeedbackResolver = {
async listFeedbacks(
root: any,
{
limit = 10, offset = 0, search, category, projectId, createdBy, status, sort = 'createdOn',
limit = 10,
offset = 0,
search,
category,
projectId,
state,
createdBy,
ticketUrl,
stackInfo,
description,
module,
status,
sort = 'createdOn',
}: any,
ctx: any,
) {
Expand All @@ -36,6 +48,11 @@ const FeedbackResolver = {
if (search) match.summary = { $regex: search, $options: 'i' };
if (category) match.category = { $in: category };
if (createdBy) match.createdBy = createdBy;
if (state) match.state = state;
if (ticketUrl) match.ticketUrl = { $regex: ticketUrl, $options: 'i' };
if (module) match.module = { $regex: module, $options: 'i' };
if (description) match.description = { $regex: description, $options: 'i' };
if (stackInfo) match['stackInfo.path'] = { $regex: stackInfo, $options: 'i' };

if (status) {
if (status === 'OPEN') {
Expand Down
5 changes: 5 additions & 0 deletions packages/feedback-service/src/feedbacks/typedef.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ type Query {
createdBy: String
status: FeedbackStatus
sortBy: FeedbackSortType
state: String
ticketUrl: String
module: String
description: String
stackInfo: String
): PaginatedFeedbackType
"""
List the Feedback by id and appId parameters
Expand Down

0 comments on commit 2e808a8

Please sign in to comment.