Skip to content

Commit

Permalink
FE-51 🔨 postEmotion 토큰 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
newjinlee committed Jul 30, 2024
1 parent 4297aa3 commit aa607ad
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/apis/postEmotion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@ import { EmotionType } from '@/types/emotion';
import type { PostEmotionRequestType, PostEmotionResponseType } from '@/schema/emotion';
import { translateEmotionToEnglish } from '@/utils/emotionMap';
import httpClient from '.';
import { getMe } from './user';

const postEmotion = async (emotion: EmotionType): Promise<PostEmotionResponseType> => {
const user = await getMe();
if (!user) {
throw new Error('로그인이 필요합니다.');
}

const englishEmotion = translateEmotionToEnglish(emotion);
const request: PostEmotionRequestType = { emotion: englishEmotion };

const response = await httpClient.post<PostEmotionResponseType>('/emotionLogs/today', {
...request,
userId: user.id,
});
const response = await httpClient.post<PostEmotionResponseType>('/emotionLogs/today', request);

return response.data;
};
Expand Down

0 comments on commit aa607ad

Please sign in to comment.