Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Team-inglo/Giggle-Web into …
Browse files Browse the repository at this point in the history
…feat/IGW-48/72
  • Loading branch information
hyeona01 committed Oct 30, 2024
2 parents 2addd90 + f26520d commit 5af900e
Show file tree
Hide file tree
Showing 26 changed files with 1,239 additions and 228 deletions.
64 changes: 58 additions & 6 deletions src/api/mypage.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,57 @@
import { RESTYPE } from '@/types/api/common';
import { api } from '.';
import { UserLanguageRequest, UserProfileBody } from '@/types/api/mypage';
import { UserLanguageRequest } from '@/types/api/mypage';
import {
ApplicationCountType,
BookmarkCountType,
EmployerCountsInfoResponse,
EmployerProfileDetailResponse,
EmployerProfileRequest,
EmployerProfileResponse,
UserEditBodyRequest,
UserProfileResponse,
UserProfileSummaryResponse,
} from '@/types/api/profile';

// 3.1 (유학생) 유저 프로필 조회하기
export const getUserProfile = async () => {
export const getUserProfile = async (): Promise<
RESTYPE<UserProfileResponse>
> => {
const response = await api.get('/users/details');
return response.data;
};

// 3.2 (고용주) 회사 정보 조회하기
export const getOwnerProfile = async (): Promise<
RESTYPE<EmployerProfileDetailResponse>
> => {
const response = await api.get('/owners/details');
return response.data;
};

// 3.3 (유학생) 유저 요약 정보 조회하기
export const getUserSummaries = async () => {
export const getUserSummaries = async (): Promise<
RESTYPE<UserProfileSummaryResponse>
> => {
const response = await api.get('/users/summaries');
return response.data;
};

// 3.4 (고용주) 고용주 간단 정보 조회하기
export const getOwnerSummaries = async (): Promise<
RESTYPE<EmployerProfileResponse>
> => {
const response = await api.get('/owners/briefs');
return response.data;
};

// 3.5 (유학생) 프로필 수정
export const patchUserProfile = async ({
image,
userProfile,
}: {
image?: File;
userProfile: UserProfileBody;
userProfile: UserEditBodyRequest;
}) => {
const formData = new FormData();

Expand All @@ -38,6 +70,14 @@ export const patchUserProfile = async ({
return response.data;
};

// 3.6 (고용주) 회사 정보 수정하기
export const patchOwnerProfile = async (
ownerProfile: EmployerProfileRequest,
) => {
const response = await api.patch('/owners', ownerProfile);
return response.data;
};

// 3.7 (유학생/고용주) 알람 설정 변경하기
export const patchNotificationAllowed = async (
is_notification_allowed: boolean,
Expand Down Expand Up @@ -69,13 +109,25 @@ export const getBookmarks = async ({
};

// 5.2 (유학생) 북마크 현황(개수) 확인하기
export const getBookmarksCounts = async () => {
export const getBookmarksCounts = async (): Promise<
RESTYPE<BookmarkCountType>
> => {
const response = await api.get('/users/book-marks/counts');
return response.data;
};

// 6.4 (유학생) 지원 현황(개수) 확인하기
export const getApplicationCounts = async () => {
export const getApplicationCounts = async (): Promise<
RESTYPE<ApplicationCountType>
> => {
const response = await api.get('/users/user-owner-job-postings/counts');
return response.data;
};

// 6.9 (고용주) 지원 현황(개수) 확인하기
export const getOwnerApplicationCounts = async (): Promise<
RESTYPE<EmployerCountsInfoResponse>
> => {
const response = await api.get('/owners/user-owner-job-postings/counts');
return response.data;
};
2 changes: 1 addition & 1 deletion src/assets/icons/Profile/ToggleBar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icons/Profile/ToggleButton.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5af900e

Please sign in to comment.