diff --git a/src/rule/dto/update-rule.dto.ts b/src/rule/dto/update-rule.dto.ts index e0ab74e..3ec862d 100644 --- a/src/rule/dto/update-rule.dto.ts +++ b/src/rule/dto/update-rule.dto.ts @@ -5,6 +5,10 @@ export class UpdateRulePairDto { @IsNumber() id: number; + @IsNotEmpty() + @IsNumber() + ruleNumber: number; + @IsNotEmpty() @IsString() ruleTitle: string; diff --git a/src/rule/rule.service.ts b/src/rule/rule.service.ts index 9e8a24b..0c1ef24 100644 --- a/src/rule/rule.service.ts +++ b/src/rule/rule.service.ts @@ -351,6 +351,8 @@ export class RuleService { // 검색 결과에 해당하는 값 찾기 // 해당 결과값을 name 혹은 nickName 에 포함하고 있는 사용자 찾기 // { id: Not(Equal(userId))} // 사용자 본인은 검색결과에 뜨지 않도록 + + console.log('검색 값: ', searchTerm); const [resultUsers, total] = await UserEntity.findAndCount({ take: cursorPageOptionsDto.take, @@ -499,6 +501,8 @@ export class RuleService { relations: { rules: true, invitations: {member : true} } }) + updateRuleDto.rulePairs.sort((a, b) => a.ruleNumber - b.ruleNumber); + rule.mainTitle = updateRuleDto.mainTitle await rule.save();