Skip to content

Commit

Permalink
Hotfix/#190 (#190)
Browse files Browse the repository at this point in the history
* [FIX] 파트에 기타 저장되는 오류 수정

* [FIX] 기타 삭제

* [FIX] 파트명 수정

* [FIX] 파트 종류 추가&수정

* [FIX] spring enum 변경

---------

Co-authored-by: yeseul106 <[email protected]>
Co-authored-by: Ji hwan Shin <[email protected]>
Co-authored-by: mikekks <[email protected]>
  • Loading branch information
4 people authored May 19, 2024
1 parent ce4340f commit ce7fb3b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ public enum UserPart {
// 파트
PM("기획"),
DESIGN("디자인"),
IOS("IOS"),
IOS("iOS"),
ANDROID("안드로이드"),
SERVER("서버"),
WEB("웹"),

// 파트장
PM_LEADER("기획 파트장"),
DESIGN_LEADER("디자인 파트장"),
IOS_LEADER("IOS 파트장"),
IOS_LEADER("iOS 파트장"),
ANDROID_LEADER("안드로이드 파트장"),
SERVER_LEADER("서버 파트장"),
WEB_LEADER("웹 파트장"),
Expand All @@ -26,8 +26,9 @@ public enum UserPart {
CHAIRMAN("회장"),
VICE_CHAIRMAN("부회장"),
GENERAL_AFFAIRS("총무"),
OPERATION_LEADER("운영팀장"),
MEDIA_LEADER("미디어팀장");
OPERATION_LEADER("운영 팀장"),
MEDIA_LEADER("미디어 팀장"),
MAKERS_LEADER("메이커스 리드");

private final String value;

Expand Down
24 changes: 14 additions & 10 deletions server/src/auth/v0/auth-v0.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ export class AuthV0Service {
);

const activities: UserActivity[] = playgroundUserActivities[0].activities.flatMap((activity) => {
return activity.cardinalInfo.split(',').map((info, index) => {
const generation = parseInt(info.split(',')[0]);
const partString = info.split(',')[1];
const part = UserPart[partString] ? UserPart[partString] : UserPart.ETC; // 파트 정보가 없는 경우 "기타"로 기본값 설정
return {
generation: generation,
part: part
};
});
});
const [generationString, partString] = activity.cardinalInfo.split(',');
const generation = parseInt(generationString);
const partKey = getKeyByValue(UserPart, partString);
const part = UserPart[partKey];

return {
generation: generation,
part: part
};
});

const phone = playgroundUserProfile.phone
? playgroundUserProfile.phone
Expand Down Expand Up @@ -91,3 +91,7 @@ export class AuthV0Service {
}
}
}

function getKeyByValue(object: any, value: string) {
return Object.keys(object).find(key => object[key] === value);
}
11 changes: 5 additions & 6 deletions server/src/entity/user/enum/user-part.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ export enum UserPart {
// 파트
PM = '기획',
DESIGN = '디자인',
IOS = 'IOS',
IOS = 'iOS',
ANDROID = '안드로이드',
SERVER = '서버',
WEB = '웹',

// 파트장
PM_LEADER = '기획 파트장',
DESIGN_LEADER = '디자인 파트장',
IOS_LEADER = 'IOS 파트장',
IOS_LEADER = 'iOS 파트장',
ANDROID_LEADER = '안드로이드 파트장',
SERVER_LEADER = '서버 파트장',
WEB_LEADER = '웹 파트장',
Expand All @@ -20,9 +20,8 @@ export enum UserPart {
CHAIRMAN = '회장',
VICE_CHAIRMAN = '부회장',
GENERAL_AFFAIRS = '총무',
OPERATION_LEADER = '운영팀장',
MEDIA_LEADER = '미디어팀장',
OPERATION_LEADER = '운영 팀장',
MEDIA_LEADER = '미디어 팀장',
MAKERS_LEADER = '메이커스 리드',

// 기타
ETC = '기타',
}

0 comments on commit ce7fb3b

Please sign in to comment.