Skip to content

Commit

Permalink
style: prettier 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
son-daehyeon committed Sep 19, 2024
1 parent 9d3eded commit 9377058
Show file tree
Hide file tree
Showing 47 changed files with 226 additions and 557 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
7 changes: 5 additions & 2 deletions src/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Wrapper

RootLayout에 아래 코드를 추가하세요.

```tsx
<WinkApiApplication>{children}</WinkApiApplication>
```
Expand Down Expand Up @@ -34,7 +35,7 @@ WinkApi.Request.setToken({
const LoginPage = () => {
const [email, setEmail] = useState<string>('');
const [password, setPassword] = useState<string>('');

const onLogin = async () => {
const { accessToken, refreshToken } = await WinkApi.Auth.login({ email, password });

Expand All @@ -58,7 +59,9 @@ const LoginPage = () => {
);
}
```

---

```tsx
'use client';

Expand Down Expand Up @@ -110,7 +113,7 @@ const MyPage = () => {
return (
<div>
<h1>My Info</h1>

<div>
<span>Name: {member.name}</span>
<span>Email: {member.email}</span>
Expand Down
4 changes: 1 addition & 3 deletions src/api/domain/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ export class Auth {
return this.request.post('/auth/register/code', data);
}

public async verifyCode(
data: VerifyCodeRequestDto,
): Promise<VerifyCodeResponseDto> {
public async verifyCode(data: VerifyCodeRequestDto): Promise<VerifyCodeResponseDto> {
return this.request.post('/auth/register/code/verify', data);
}

Expand Down
31 changes: 8 additions & 23 deletions src/api/domain/Member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,11 @@ export class Member {
return this.request.put('/member/me/info', data);
}

public async updateMyPassword(
data: UpdateMyPasswordRequestDto,
): Promise<void> {
public async updateMyPassword(data: UpdateMyPasswordRequestDto): Promise<void> {
return this.request.patch('/member/me/password', data);
}

public async updateMyAvatar(
avatar: File,
): Promise<UpdateMyAvatarResponseDto> {
public async updateMyAvatar(avatar: File): Promise<UpdateMyAvatarResponseDto> {
const data = new FormData();
data.append('avatar', avatar);

Expand All @@ -38,15 +34,11 @@ export class MemberAdmin {
return this.request.get('/admin/member/waiting');
}

public async approveWaitingMember(
data: ApproveWaitingMemberRequestDto,
): Promise<void> {
public async approveWaitingMember(data: ApproveWaitingMemberRequestDto): Promise<void> {
return this.request.post('/admin/member/waiting/approve', data);
}

public async rejectWaitingMember(
data: RejectWaitingMemberRequestDto,
): Promise<void> {
public async rejectWaitingMember(data: RejectWaitingMemberRequestDto): Promise<void> {
return this.request.post('/admin/member/waiting/reject', data);
}

Expand All @@ -60,15 +52,11 @@ export class MemberAdmin {
return this.request.get('/admin/member?page=' + data.page);
}

public async searchMembers(
data: SearchMembersRequestDto,
): Promise<SearchMembersResponseDto> {
public async searchMembers(data: SearchMembersRequestDto): Promise<SearchMembersResponseDto> {
return this.request.get('/admin/member/search?query=' + data.query);
}

public async updateMemberRole(
data: UpdateMemberRoleRequestDto,
): Promise<void> {
public async updateMemberRole(data: UpdateMemberRoleRequestDto): Promise<void> {
return this.request.patch('/admin/member/role', data);
}

Expand Down Expand Up @@ -130,8 +118,7 @@ export interface EachGetMembersResponseDto {
role: RoleString;
}

export interface EachGetMembersForAdminResponseDto
extends EachGetMembersResponseDto {
export interface EachGetMembersForAdminResponseDto extends EachGetMembersResponseDto {
email: string;
studentId: string;
fee: boolean;
Expand Down Expand Up @@ -205,9 +192,7 @@ export const RoleKoreanMap: Record<RoleString, string> = {
export const RoleKorean = Object.values(RoleKoreanMap);

export const RoleKoreanToRole = (role: string): Role => {
const key = Object.keys(RoleKoreanMap).find(
key => RoleKoreanMap[key as RoleString] === role,
);
const key = Object.keys(RoleKoreanMap).find((key) => RoleKoreanMap[key as RoleString] === role);
return Role[key as RoleString];
};

Expand Down
20 changes: 5 additions & 15 deletions src/api/domain/activity/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,27 @@ import { MemberType, WinkApiRequest } from '@/api';
export class Project {
constructor(private readonly request: WinkApiRequest) {}

public async getProject(
data: GetProjectRequestDto,
): Promise<GetProjectResponseDto> {
return this.request.get(
'/activity/project/detail?projectId=' + data.projectId,
);
public async getProject(data: GetProjectRequestDto): Promise<GetProjectResponseDto> {
return this.request.get('/activity/project/detail?projectId=' + data.projectId);
}

public async getProjectsPage(): Promise<GetProjectsPageResponseDto> {
return this.request.get('/activity/project/max');
}

public async getProjects(
data: GetProjectsRequestDto,
): Promise<GetProjectsResponseDto> {
public async getProjects(data: GetProjectsRequestDto): Promise<GetProjectsResponseDto> {
return this.request.get('/activity/project?page=' + data.page);
}

public async searchProjects(
data: SearchProjectsRequestDto,
): Promise<GetProjectsResponseDto> {
public async searchProjects(data: SearchProjectsRequestDto): Promise<GetProjectsResponseDto> {
return this.request.get('/activity/project/search?query=' + data.query);
}
}

export class ProjectAdmin {
constructor(private readonly request: WinkApiRequest) {}

public async createProject(
data: CreateProjectRequestDto,
): Promise<CreateProjectResponseDto> {
public async createProject(data: CreateProjectRequestDto): Promise<CreateProjectResponseDto> {
return this.request.put('/admin/activity/project', data);
}

Expand Down
20 changes: 5 additions & 15 deletions src/api/domain/activity/Social.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,27 @@ import { WinkApiRequest } from '@/api';
export class Social {
constructor(private readonly request: WinkApiRequest) {}

public async getSocial(
data: GetSocialRequestDto,
): Promise<GetSocialResponseDto> {
return this.request.get(
'/activity/social/detail?socialId=' + data.socialId,
);
public async getSocial(data: GetSocialRequestDto): Promise<GetSocialResponseDto> {
return this.request.get('/activity/social/detail?socialId=' + data.socialId);
}

public async getSocialsPage(): Promise<GetSocialsPageResponseDto> {
return this.request.get('/activity/social/max');
}

public async getSocials(
data: GetSocialsRequestDto,
): Promise<GetSocialsResponseDto> {
public async getSocials(data: GetSocialsRequestDto): Promise<GetSocialsResponseDto> {
return this.request.get('/activity/social?page=' + data.page);
}

public async searchSocials(
data: SearchSocialsRequestDto,
): Promise<GetSocialsResponseDto> {
public async searchSocials(data: SearchSocialsRequestDto): Promise<GetSocialsResponseDto> {
return this.request.get('/activity/social/search?query=' + data.query);
}
}

export class SocialAdmin {
constructor(private readonly request: WinkApiRequest) {}

public async createSocial(
data: CreateSocialRequestDto,
): Promise<CreateSocialResponseDto> {
public async createSocial(data: CreateSocialRequestDto): Promise<CreateSocialResponseDto> {
return this.request.put('/admin/activity/social', data);
}

Expand Down
16 changes: 4 additions & 12 deletions src/api/domain/activity/Study.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,19 @@ export class Study {
return this.request.get('/activity/study/max');
}

public async getStudies(
data: GetStudiesRequestDto,
): Promise<GetStudiesResponse> {
public async getStudies(data: GetStudiesRequestDto): Promise<GetStudiesResponse> {
return this.request.get('/activity/study?page=' + data.page);
}

public async searchStudies(
data: SearchStudiesRequestDto,
): Promise<GetStudiesResponse> {
public async searchStudies(data: SearchStudiesRequestDto): Promise<GetStudiesResponse> {
return this.request.get('/activity/study/search?query=' + data.query);
}
}

export class StudyAdmin {
constructor(private readonly request: WinkApiRequest) {}

public async createCategory(
data: CreateCategoryRequestDto,
): Promise<CreateCategoryResponseDto> {
public async createCategory(data: CreateCategoryRequestDto): Promise<CreateCategoryResponseDto> {
return this.request.put('/admin/activity/study/category', data);
}

Expand All @@ -41,9 +35,7 @@ export class StudyAdmin {
return this.request.delete('/admin/activity/study/category', data);
}

public async createStudy(
data: CreateStudyRequestDto,
): Promise<CreateStudyResponseDto> {
public async createStudy(data: CreateStudyRequestDto): Promise<CreateStudyResponseDto> {
return this.request.put('/admin/activity/study', data);
}

Expand Down
9 changes: 3 additions & 6 deletions src/api/request/WinkApiRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,9 @@ export class WinkApiRequest {

private async refresh(): Promise<boolean> {
try {
const { accessToken, refreshToken } = await this.post<RefreshResponseDto>(
'/auth/refresh',
{
refreshToken: this.refreshToken,
},
);
const { accessToken, refreshToken } = await this.post<RefreshResponseDto>('/auth/refresh', {
refreshToken: this.refreshToken,
});

this.setToken(accessToken, refreshToken);

Expand Down
37 changes: 10 additions & 27 deletions src/app/about-us/member/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,21 @@ const MEMBERS = [
description: '비품 및 회비 관리, 도서 신청 및 대출 관리',
filter: (member: EachGetMembersResponseDto) =>
member.role === 'TREASURY_HEAD' || member.role === 'TREASURY_ASSISTANT',
sort: (a: EachGetMembersResponseDto) =>
a.role === 'TREASURY_HEAD' ? -1 : 1,
sort: (a: EachGetMembersResponseDto) => (a.role === 'TREASURY_HEAD' ? -1 : 1),
},
{
title: '홍보부',
description: '동아리 홍보 및 홍보물 제작, SNS 관리',
filter: (member: EachGetMembersResponseDto) =>
member.role === 'PUBLIC_RELATIONS_HEAD' ||
member.role === 'PUBLIC_RELATIONS_ASSISTANT',
sort: (a: EachGetMembersResponseDto) =>
a.role === 'PUBLIC_RELATIONS_HEAD' ? -1 : 1,
member.role === 'PUBLIC_RELATIONS_HEAD' || member.role === 'PUBLIC_RELATIONS_ASSISTANT',
sort: (a: EachGetMembersResponseDto) => (a.role === 'PUBLIC_RELATIONS_HEAD' ? -1 : 1),
},
{
title: '기획부',
description: '동아리 행사 기획 및 진행, 회의록 작성',
filter: (member: EachGetMembersResponseDto) =>
member.role === 'PLANNING_HEAD' || member.role === 'PLANNING_ASSISTANT',
sort: (a: EachGetMembersResponseDto) =>
a.role === 'PLANNING_HEAD' ? -1 : 1,
sort: (a: EachGetMembersResponseDto) => (a.role === 'PLANNING_HEAD' ? -1 : 1),
},
];

Expand All @@ -55,12 +51,7 @@ const AboutUsMemberPage = () => {
return (
<div className="flex flex-col items-center mt-32">
<div className="flex flex-col items-center justify-center gap-2">
<Image
src={cloudImage}
alt="cloud"
width={224}
className="w-56 animate-updown"
/>
<Image src={cloudImage} alt="cloud" width={224} className="w-56 animate-updown" />
<h1 className="font-roboto font-extrabold text-5xl lg:text-7xl text-wink-200 tracking-wider">
NEW WAVE IN US
</h1>
Expand All @@ -80,12 +71,8 @@ const AboutUsMemberPage = () => {

<div className="flex flex-wrap justify-center gap-4 px-12">
{members
.filter(
member =>
member.role === 'PRESIDENT' ||
member.role === 'VICE_PRESIDENT',
)
.sort(a => (a.role === 'PRESIDENT' ? -1 : 1))
.filter((member) => member.role === 'PRESIDENT' || member.role === 'VICE_PRESIDENT')
.sort((a) => (a.role === 'PRESIDENT' ? -1 : 1))
.map(({ _id, name, avatar, description, link, role }) => (
<ProfileCard
key={_id}
Expand All @@ -105,12 +92,8 @@ const AboutUsMemberPage = () => {
<div className="flex flex-row items-start gap-8">
{MEMBERS.map(({ title, description, filter, sort }) => (
<div className="flex flex-col items-center justify-center gap-6">
<h1 className="font-bold text-3xl text-center">
&lt;{title}&gt;
</h1>
<p className="font-regular text-lg text-center text-zinc-700]">
{description}
</p>
<h1 className="font-bold text-3xl text-center">&lt;{title}&gt;</h1>
<p className="font-regular text-lg text-center text-zinc-700]">{description}</p>

<div className="flex flex-col gap-6">
{members
Expand All @@ -136,7 +119,7 @@ const AboutUsMemberPage = () => {
<div className="mt-16">
<div className="flex flex-wrap justify-center gap-4 px-12">
{members
.filter(member => member.role === 'MEMBER')
.filter((member) => member.role === 'MEMBER')
.sort((a, b) => a.name.localeCompare(b.name))
.map(({ _id, name, avatar, description, link }) => (
<ProfileCard
Expand Down
Loading

0 comments on commit 9377058

Please sign in to comment.