Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
fix : 규칙 조회 id 기준 정렬 (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
yewonahn authored Feb 12, 2024
2 parents f87cc72 + b36acc6 commit 5f1c6e5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/rule/rule.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { S3UtilService} from "../utils/S3.service";
import { GetMemberListDto} from "./dto/get-member-list.dto";
import {UserService} from "../user/user.service";
import {GetRuleListDto, MemberPairDto} from "./dto/get-rule-list.dto";
import { Equal, LessThan, Like, MoreThan, Not } from 'typeorm';
import {Brackets, Equal, LessThan, Like, MoreThan, Not} from 'typeorm';
import {GetSearchMemberDto} from "./dto/get-search-member.dto";
import {UpdateRuleDto} from "./dto/update-rule.dto";
import {CursorPageOptionsDto} from "../mate/cursor-page/cursor-page-option.dto";
Expand Down Expand Up @@ -106,7 +106,7 @@ export class RuleService {
rulePair.ruleDetail = sub.ruleDetail;

return rulePair;
}));
})).then(rulePairs => rulePairs.sort((a, b) => a.id - b.id));

// -3) 멤버 정보
dto.detailMembers = await Promise.all(invitations.map(async(invitation):Promise<DetailMemberDto> => {
Expand Down Expand Up @@ -351,8 +351,14 @@ export class RuleService {
const [resultUsers, total] = await UserEntity.findAndCount({
take: cursorPageOptionsDto.take,
where: [
{ id: cursorId ? LessThan(cursorId) : null, name: Like(`%${searchTerm}%`) },
{ id: cursorId ? LessThan(cursorId) : null, nickname: Like(`%${searchTerm}%`)},
{
id: cursorId ? LessThan(cursorId) : null,
name: Like(`%${searchTerm}%`),
},
{
id: cursorId ? LessThan(cursorId) : null,
nickname: Like(`%${searchTerm}%`),
}
],
relations: {profileImage : true, ruleParticipate: {rule: true}},
order: {
Expand Down

0 comments on commit 5f1c6e5

Please sign in to comment.