-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor/mentor profile update (#131)
* 🚀 [Docs, Deploy]: api docs trigger 생성 * ✨ [Feat]: schema 변경 - mentorProfile social link not null * [Feat]: dto optional 제거 - 프론트측에서 optional dto를 사용하지 않는것으로 확인되어 optional 해제했습니다. * [Feat, Fix]: activation api 생성 ,null 체크 해제 - activation api를 새로 생성했습니다. - dto에서 null check를하기때문에 controller에서 하지않습니다. * [Feat]: dto update - activation dto 별도로 생성. - dto nullable 해제. socialLink는 optional로 null인경우 regex 확인X - null이 아닌경우 regex에서 체크함. * [Feat]: mentorProfile repository - update할때 프로필 숨겨야할때 validation추가. socialLink의 경우, Null을 체크 * feat(mentorProfileService): update/activate/deactive 호출 * feat: update api-docs
- Loading branch information
1 parent
aa5e4aa
commit 156b0da
Showing
9 changed files
with
243 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Trigger Api-Docs deployer | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
paths: | ||
- 'api-docs.yml' | ||
|
||
jobs: | ||
trigger: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: api-docs repository의 dispatcher를 트리거합니다. | ||
run: | | ||
curl -X POST \ | ||
-H "Authorization: token ${{ secrets.DISPATCHER_PAT_MYUKANG }}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
https://api.github.com/repos/manito42/api-docs/actions/workflows/71662751/dispatches \ | ||
-d '{"ref":"master"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
prisma/migrations/20231005163230_disable_null_social_link/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
Warnings: | ||
- Made the column `socialLink` on table `mentor_profiles` required. This step will fail if there are existing NULL values in that column. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE `mentor_profiles` MODIFY `socialLink` VARCHAR(255) NOT NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/models/mentorProfile/dto/request/mentorProfileActivate.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { IsBoolean } from 'class-validator'; | ||
|
||
export class MentorProfileActivateDto { | ||
@IsBoolean({ message: 'isHide는 boolean 타입이어야 합니다' }) | ||
isHide: boolean; | ||
} |
32 changes: 17 additions & 15 deletions
32
src/models/mentorProfile/dto/request/mentorProfileUpdatePayload.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
import { ArrayMaxSize, IsOptional, IsString, Matches, MaxLength, MinLength } from 'class-validator'; | ||
import { | ||
ArrayMaxSize, | ||
IsArray, | ||
IsOptional, | ||
IsString, | ||
Matches, | ||
MaxLength, | ||
MinLength, | ||
} from 'class-validator'; | ||
import { IMentorProfileUpdateRequest } from '../../../../common/interfaces/api/mentorProfile/mentorProfileRequest.interface'; | ||
|
||
export class MentorProfileUpdatePayloadDto implements IMentorProfileUpdateRequest { | ||
@MinLength(0, { message: 'shortDescription은 최소 0글자 이상이어야 합니다.' }) | ||
@MaxLength(50, { | ||
message: 'shortDescription은 최대 50자 이하여야 합니다.', | ||
}) | ||
@IsOptional() | ||
shortDescription?: string; | ||
shortDescription: string; | ||
|
||
@MinLength(0, { message: 'description은 최소 0글자 이상이어야 합니다.' }) | ||
@MaxLength(1000, { | ||
message: 'description은 최대 1000자 이하여야 합니다.', | ||
}) | ||
@IsOptional() | ||
description?: string; | ||
description: string; | ||
|
||
@ArrayMaxSize(5, { message: '해시태그는 5개 이하로 입력해주세요.' }) | ||
@IsOptional() | ||
hashtags?: { id: number }[]; | ||
|
||
@IsOptional() | ||
categories?: { id: number }[]; | ||
hashtags: { id: number }[]; | ||
|
||
@IsOptional() | ||
isHide?: boolean; | ||
@IsArray() | ||
categories: { id: number }[]; | ||
|
||
@IsOptional() | ||
@IsString() | ||
@Matches('https://42born2code.slack.com/team/[a-zA-Z0-9_]+') | ||
socialLink?: string; | ||
@IsOptional() | ||
@Matches('https://42born2code.slack.com/team/[a-zA-Z0-9_-]+') | ||
socialLink: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.