Skip to content

Commit

Permalink
feat: 관심사 id로 쿼리할 수 있도록 구현 (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
Coalery authored Oct 28, 2023
1 parent 122c031 commit 52f3792
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/app/application/group/query/IGroupQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { GroupListView } from '@sight/app/application/group/query/view/GroupList
type ListGroupParams = {
queryType: GroupListQueryType;
keyword: string | null;
interestId: string | null;
limit: number;
offset: number;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class ListGroupQuery implements IQuery {
constructor(
readonly queryType: GroupListQueryType,
readonly keyword: string | null,
readonly interestId: string | null,
readonly limit: number,
readonly offset: number,
) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ describe('ListGroupQueryHandler', () => {

const queryType = GroupListQueryType.MY;
const keyword = 'keyword';
const interestId = 'interestId';
const limit = 50;
const offset = 0;

beforeEach(() => {
query = new ListGroupQuery(queryType, keyword, limit, offset);
query = new ListGroupQuery(queryType, keyword, interestId, limit, offset);
listView = ViewFixture.generateGroupListView();

groupQuery.listGroup = jest.fn().mockResolvedValue(listView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ export class ListGroupQueryHandler
) {}

async execute(query: ListGroupQuery): Promise<ListGroupQueryResult> {
const { queryType, keyword, limit, offset } = query;
const { queryType, keyword, interestId, limit, offset } = query;

const listView = await this.groupQuery.listGroup({
queryType,
keyword,
interestId,
limit,
offset,
});
Expand Down

0 comments on commit 52f3792

Please sign in to comment.