Skip to content

Commit

Permalink
Refactor: #153 전체 유저 검색 & 팀 유저 검색 axios 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Seok93 committed Sep 23, 2024
1 parent e11a62e commit bc10423
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/services/teamService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { authAxios } from '@services/axiosProvider';
import type { AxiosRequestConfig } from 'axios';
import type { User } from '@/types/UserType';
import type { SearchUser, User } from '@/types/UserType';
import type { Team } from '@/types/TeamType';

/**
Expand All @@ -11,14 +11,14 @@ import type { Team } from '@/types/TeamType';
* @param {Team['teamId']} teamId - 팀 아이디
* @param {User['nickname']} nickname - 유저 닉네임
* @param {AxiosRequestConfig} [axiosConfig={}] - axios 요청 옵션 설정 객체
* @returns {Promise<AxiosResponse<User[]>>}
* @returns {Promise<AxiosResponse<SearchUser[]>>}
*/
async function findUserByTeam(
export async function findUserByTeam(
teamId: Team['teamId'],
nickname: User['nickname'],
axiosConfig: AxiosRequestConfig = {},
) {
return authAxios.get<User[]>(`/team/${teamId}/user/search?nickname=${nickname}`, axiosConfig);
return authAxios.get<SearchUser[]>(`/team/${teamId}/user/search?nickname=${nickname}`, axiosConfig);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/services/userService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { authAxios } from '@services/axiosProvider';
import type { AxiosRequestConfig } from 'axios';
import type { User } from '@/types/UserType';
import type { SearchUser } from '@/types/UserType';
import type { TeamListWithApproval } from '@/types/TeamType';

/**
Expand All @@ -10,10 +10,10 @@ import type { TeamListWithApproval } from '@/types/TeamType';
* @async
* @param {User['nickname']} nickname - 유저 닉네임
* @param {AxiosRequestConfig} [axiosConfig={}] - axios 요청 옵션 설정 객체
* @returns {Promise<AxiosResponse<User[]>>}
* @returns {Promise<AxiosResponse<SearchUser[]>>}
*/
async function findUser(nickname: string, axiosConfig: AxiosRequestConfig = {}) {
return authAxios.get<User[]>(`/user/search?nickname=${nickname}`, axiosConfig);
export async function findUser(nickname: string, axiosConfig: AxiosRequestConfig = {}) {
return authAxios.get<SearchUser[]>(`/user/search?nickname=${nickname}`, axiosConfig);
}

/**
Expand Down

0 comments on commit bc10423

Please sign in to comment.