Skip to content

Commit

Permalink
FE-54๐Ÿ”€ ์ƒ์„ธํŽ˜์ด์ง€ main merge (#120)
Browse files Browse the repository at this point in the history
* FE-31 ์ƒ์„ธํŽ˜์ด์ง€ UI ์ œ์ž‘ (#12)

* FE-31๐Ÿ’„์ƒ์„ธํŽ˜์ด์ง€ ๊ธฐ๋ณธ UI ์ œ์ž‘

* FE-31โ™ป๏ธ textareaํƒœ๊ทธ Textarea์ปดํฌ๋„ŒํŠธ๋กœ ๋ณ€๊ฒฝ

* FE-31๐Ÿ’„ ๋ฐ˜์‘ํ˜• ๋””์ž์ธ ์ถ”๊ฐ€

---------

Co-authored-by: Woojiseok <[email protected]>

* FE-43 โœจ ์ƒ์„ธํŽ˜์ด์ง€ ์—ํ”ผ๊ทธ๋žจ ์กฐํšŒ  (#18)

* FE-43โœจ ์ƒ์„ธํŽ˜์ด์ง€ Epigram API์—ฐ๋™

* FE-43โšก ๏ธaxios ์—๋Ÿฌ ํ•ธ๋“ค๋ง ์ถ”๊ฐ€

* FE-43๐Ÿ—๏ธ ์ƒ์„ธํŽ˜์ด์ง€ Layout ๊ตฌ์กฐ๊ฐœ์„ 

* FE-43๐Ÿ“ ์ฃผ์„ ์ถ”๊ฐ€

* FE-43๐Ÿ”ฅ ์‚ฌ์šฉ์•ˆํ•˜๋Š” ํŒŒ์ผ ์‚ญ์ œ

* FE-43โœ๏ธ ์˜คํƒ€ ์ˆ˜์ •

* FE-43 ๐Ÿ› id์—†์„๋•Œ useQuery์‹คํ–‰๋˜๋Š” ๋ฌธ์ œ ํ•ด๊ฒฐ

* FE-43โ™ป๏ธ  interface->zod ๋ณ€๊ฒฝ

---------

Co-authored-by: ์šฐ์ง€์„ <[email protected]>

* FE-43โœจ ์‚ฌ์šฉ์ž ID์— ๋”ฐ๋ฅธ ๋ฏธํŠธ๋ณผ์•„์ด์ฝ˜ ํ‘œ์‹œ (#22)

* FE-43โœจ ์‚ฌ์šฉ์ž ID์— ๋”ฐ๋ฅธ ๋ฏธํŠธ๋ณผ์•„์ด์ฝ˜ ํ‘œ์‹œ

* FE-43โœจ ์—ํ”ผ๊ทธ๋žจ ์ƒ์„ธํŽ˜์ด์ง€ ๋”๋ณด๊ธฐ ๋“œ๋กญ๋‹ค์šด ์ถ”๊ฐ€

* FE-43๐Ÿ’„ MoreOptionMenu ์Šคํƒ€์ผ ์ˆ˜์ •

* FE-31 ์ƒ์„ธํŽ˜์ด์ง€ UI ์ œ์ž‘ (#12)

* FE-31๐Ÿ’„์ƒ์„ธํŽ˜์ด์ง€ ๊ธฐ๋ณธ UI ์ œ์ž‘

* FE-31โ™ป๏ธ textareaํƒœ๊ทธ Textarea์ปดํฌ๋„ŒํŠธ๋กœ ๋ณ€๊ฒฝ

* FE-31๐Ÿ’„ ๋ฐ˜์‘ํ˜• ๋””์ž์ธ ์ถ”๊ฐ€

---------

Co-authored-by: Woojiseok <[email protected]>

* FE-43 โœจ ์ƒ์„ธํŽ˜์ด์ง€ ์—ํ”ผ๊ทธ๋žจ ์กฐํšŒ  (#18)

* FE-43โœจ ์ƒ์„ธํŽ˜์ด์ง€ Epigram API์—ฐ๋™

* FE-43โšก ๏ธaxios ์—๋Ÿฌ ํ•ธ๋“ค๋ง ์ถ”๊ฐ€

* FE-43๐Ÿ—๏ธ ์ƒ์„ธํŽ˜์ด์ง€ Layout ๊ตฌ์กฐ๊ฐœ์„ 

* FE-43๐Ÿ“ ์ฃผ์„ ์ถ”๊ฐ€

* FE-43๐Ÿ”ฅ ์‚ฌ์šฉ์•ˆํ•˜๋Š” ํŒŒ์ผ ์‚ญ์ œ

* FE-43โœ๏ธ ์˜คํƒ€ ์ˆ˜์ •

* FE-43 ๐Ÿ› id์—†์„๋•Œ useQuery์‹คํ–‰๋˜๋Š” ๋ฌธ์ œ ํ•ด๊ฒฐ

* FE-43โ™ป๏ธ  interface->zod ๋ณ€๊ฒฝ

---------

Co-authored-by: ์šฐ์ง€์„ <[email protected]>

* FE-43โœจ ์‚ฌ์šฉ์ž ID์— ๋”ฐ๋ฅธ ๋ฏธํŠธ๋ณผ์•„์ด์ฝ˜ ํ‘œ์‹œ (#22)

* FE-43โœจ ์‚ฌ์šฉ์ž ID์— ๋”ฐ๋ฅธ ๋ฏธํŠธ๋ณผ์•„์ด์ฝ˜ ํ‘œ์‹œ

* FE-43โœจ ์—ํ”ผ๊ทธ๋žจ ์ƒ์„ธํŽ˜์ด์ง€ ๋”๋ณด๊ธฐ ๋“œ๋กญ๋‹ค์šด ์ถ”๊ฐ€

* FE-43๐Ÿ’„ MoreOptionMenu ์Šคํƒ€์ผ ์ˆ˜์ •

* โœจ ์ƒ์„ธํŽ˜์ด์ง€ ๋Œ“๊ธ€ ์กฐํšŒ api์—ฐ๋™ (#38)

* FE-42๐Ÿ’„ EpigramComment์•ˆ์— CommentCard ์ถ”๊ฐ€

* FE-42โœจ ์ƒ์„ธํŽ˜์ด์ง€ ๋Œ“๊ธ€ ์กฐํšŒ api์—ฐ๋™

* FE-42โœจ dateUtilํ•จ์ˆ˜ ์ถ”๊ฐ€, ์ ์šฉ

* FE-42โœจ ๋Œ“๊ธ€์ž‘์„ฑ์ž๊ฐ€ ๋ณธ์ธ์ธ์ง€ ํŒ๋ณ„ํ•ด ์ˆ˜์ •,์‚ญ์ œ ํ‘œ์‹œ

* FE-42๐Ÿ”ฅ ์•ˆ์“ฐ๋Š” ํ•จ์ˆ˜ ์‚ญ์ œ

* FE-42๐Ÿ’„ EpigramComment ๋ฐฐ๊ฒฝ์ƒ‰ ์ˆ˜์ •

* FE-42โ™ป๏ธ CommetCard ๊ตฌ์กฐ ๊ฐœ์„ 

* FE-42๐Ÿ’„์ž‘์„ฑ๋œ ๋Œ“๊ธ€ ์—†์„๋•Œ UI ์ถ”๊ฐ€

* FE-42๐Ÿ› ๋Œ“๊ธ€์ˆ˜๋ฅผ  length->totalCount๋กœ ๋ณ€๊ฒฝ

* FE-42โ™ป๏ธ  useEpigramCommentHook ๋ถ„๋ฆฌ

* FE-42โœจ ๋Œ“๊ธ€ ๋ชฉ๋ก์— ๋ฌดํ•œ์Šคํฌ๋กค ์ ์šฉ

* FE-42๐Ÿ’ก ์ฃผ์„ ์ถ”๊ฐ€

---------

Co-authored-by: ์šฐ์ง€์„ <[email protected]>

* FE-76โœจ ๋Œ“๊ธ€ ์ž‘์„ฑ api ์—ฐ๋™ (#78)

* FE-76โ™ป๏ธ  ๋Œ“๊ธ€ textarea ์ปดํฌ๋„ŒํŠธ ๋ถ„๋ฆฌ

* FE-76๐Ÿ’„ switch ์ปดํฌ๋„ŒํŠธ ์Šคํƒ€์ผ ์ˆ˜์ •

* FE-76โœจ textarea focus out ๋ฒ„ํŠผ ์ถ”๊ฐ€

* FE-76โœจ postComment schema,interface ์ถ”๊ฐ€, ์ˆ˜์ •

* FE-76โœจ  ๋Œ“๊ธ€ ์ž‘์„ฑ api ์—ฐ๋™

* FE-76๐Ÿ› import error ํ•ด๊ฒฐ

* FE-76โœจ  switch๋กœ ๋Œ“๊ธ€ ๊ณต๊ฐœ,๋น„๊ณต๊ฐœ ์„ค์ • ๊ธฐ๋Šฅ ์ถ”๊ฐ€

* FE-76โœจ ๋Œ“๊ธ€ ์ž‘์„ฑ ์‹œ image๋ฅผ ์œ ์ €๊ฐ€ ๋“ฑ๋กํ•œ image๋กœ ๋ณ€๊ฒฝ

* FE-76๐Ÿ› build error ํ•ด๊ฒฐ

---------

Co-authored-by: ์šฐ์ง€์„ <[email protected]>

* FE-45โœจ ์—ํ”ผ๊ทธ๋žจ ์‚ญ์ œ api ์—ฐ๋™ (#80)

* FE-45โœจ ์—ํ”ผ๊ทธ๋žจ ์‚ญ์ œ api ์—ฐ๋™

* FE-45๐Ÿ’„ ์—ํ”ผ๊ทธ๋žจ ์‚ญ์ œ ๋ชจ๋‹ฌ ์ถ”๊ฐ€

* FE-45๐Ÿ’„ ๋ฐ˜์‘ํ˜• ๋””์ž์ธ ์ˆ˜์ •

* FE-45โ™ป๏ธ DeleteAlertModal ์ปดํฌ๋„ŒํŠธ ๋ถ„๋ฆฌ

* FE-45๐Ÿ› build error ํ•ด๊ฒฐ

---------

Co-authored-by: ์šฐ์ง€์„ <[email protected]>

* FE-78โœจ๋Œ“๊ธ€ ์ˆ˜์ •,์‚ญ์ œ ๊ธฐ๋Šฅ ์ถ”๊ฐ€ (#91)

* FE-78๐Ÿ’„ ๋ฏธํŠธ๋ณผ์•„์ด์ฝ˜ ui์ˆ˜์ •

* FE-78โœจ ๋Œ“๊ธ€ ์‚ญ์ œ ํ•จ์ˆ˜ ์ถ”๊ฐ€

* FE-78โœจ๋Œ“๊ธ€ ์‚ญ์ œ ๋ฒ„ํŠผ ๊ธฐ๋Šฅ ์ถ”๊ฐ€

* FE-78โœจ  ๋Œ“๊ธ€ ์ˆ˜์ • apiํ•จ์ˆ˜ ์ถ”๊ฐ€

* FE-78โœจ ๋Œ“๊ธ€ ์ˆ˜์ • ๊ธฐ๋Šฅ ์ถ”๊ฐ€

* FE-78๐Ÿ“ ์ฃผ์„ ์ถ”๊ฐ€

* FE-78๐Ÿ’„ EpigramComment height์ˆ˜์ •

* FE-78๐Ÿ› build error ํ•ด๊ฒฐ

---------

Co-authored-by: ์šฐ์ง€์„ <[email protected]>

* FE-44โœจ ์—ํ”ผ๊ทธ๋žจ ์ˆ˜์ • ๊ธฐ๋Šฅ ์ถ”๊ฐ€ (#97)

* FE-44๐Ÿšš ์ƒ์„ธํŽ˜์ด์ง€ ํŽ˜์ด์ง€ ๊ตฌ์กฐ ๋ณ€๊ฒฝ

* FE-44โœจ  ์—ํ”ผ๊ทธ๋žจ ์ˆ˜์ • api ํ•จ์ˆ˜ ์ถ”๊ฐ€

* FE-44โœจ ์—ํ”ผ๊ทธ๋žจ ์ˆ˜์ • ๊ธฐ๋Šฅ ์ถ”๊ฐ€

* FE-44โ™ป๏ธ ์ €์ž์„ ํƒ๊ด€๋ จ ํ•จ์ˆ˜ useAuthorSelectionํ›…์œผ๋กœ ๋ถ„๋ฆฌ

* FE-44๐Ÿ’„ EditEpigram,AddEpigram UI์ˆ˜์ •

* FE-44๐Ÿ› ์ถœ์ฒ˜ ์œ ํšจ์„ฑ๊ฒ€์‚ฌ ๋ฒ„๊ทธ ์ˆ˜์ •

* FE-44โœจ ์ž‘์„ฑ์ž ๋ณธ์ธ์ด ์•„๋‹๋•Œ ์ˆ˜์ •ํŽ˜์ด์ง€ ์ ‘๊ทผ ์‹œ ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ ๊ธฐ๋Šฅ ๊ตฌํ˜„

* FE-44๐Ÿ› ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ๋ฒ„๊ทธ ์ˆ˜์ •

---------

Co-authored-by: ์šฐ์ง€์„ <[email protected]>

* FE-41โœจ์ข‹์•„์š” ๊ธฐ๋Šฅ ์ถ”๊ฐ€ (#103)

* FE-41โ™ป๏ธ  httpClien์—t interceoptor ์ถ”๊ฐ€

* FE-41โœจ  ์ข‹์•„์š” api ํ•จ์ˆ˜ ์ถ”๊ฐ€

* FE-41โœจ  ์ข‹์•„์š” ๊ธฐ๋Šฅ Layout์— ์ ์šฉ

* FE-41โœจ Url Link๋ฒ„ํŠผ ์ƒ์„ฑ

* FE-41๐Ÿ’„์ข‹์•„์š”,link๋ฒ„ํŠผ ์Šคํƒ€์ผ ์ˆ˜์ •

* FE-41๐Ÿ› import ์—๋Ÿฌ ํ•ด๊ฒฐ

* FE-41โ™ป๏ธ ๊ธฐ์กดheader-> Header์ปดํฌ๋„ŒํŠธ๋กœ ๋ณ€๊ฒฝ

---------

Co-authored-by: ์šฐ์ง€์„ <[email protected]>

* FE-54๐Ÿ› ์˜คํƒ€ ์ˆ˜์ •

* build error ํ•ด๊ฒฐ

---------

Co-authored-by: Woojiseok <[email protected]>
  • Loading branch information
jisurk and Woojiseok authored Jul 31, 2024
1 parent 111eabf commit 52b7c9e
Show file tree
Hide file tree
Showing 36 changed files with 1,274 additions and 64 deletions.
7 changes: 0 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions public/arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/icon/cancelIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/likeIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/meatballIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/placeLink.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions public/profile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/share.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions src/apis/epigram.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import axios, { AxiosError } from 'axios';
import { GetEpigramResponseType, EpigramRequestType } from '@/schema/epigram';
import { DeleteEpigramType } from '@/types/epigram.types';
import { AddEpigramResponseType, EditEpigramRequestType } from '@/schema/addEpigram';
import httpClient from '.';

export const getEpigram = async (request: EpigramRequestType): Promise<GetEpigramResponseType> => {
const { id } = request;

if (id === undefined) {
throw new Error('Epigram ID๊ฐ€ ์ œ๊ณต๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.');
}

try {
const response = await httpClient.get(`/epigrams/${id}`);
return response.data;
} catch (error) {
if (axios.isAxiosError(error)) {
const axiosError = error as AxiosError;
if (axiosError.response) {
throw new Error(`API ์—๋Ÿฌ: ${axiosError.response.status}`);
} else if (axiosError.request) {
throw new Error('์„œ๋ฒ„๋กœ๋ถ€ํ„ฐ ์‘๋‹ต์„ ๋ฐ›์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค.');
} else {
throw new Error('์š”์ฒญ ์„ค์ • ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.');
}
} else {
throw new Error('์˜ˆ์ƒ์น˜ ๋ชปํ•œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.');
}
}
};

export const deleteEpigram = async (id: number): Promise<DeleteEpigramType> => {
const response = await httpClient.delete(`/epigrams/${id}`);
return response.data;
};

// NOTE: ์—ํ”ผ๊ทธ๋žจ ์ˆ˜์ • api ํ•จ์ˆ˜
export const patchEpigram = async (request: EditEpigramRequestType): Promise<AddEpigramResponseType> => {
const { id, ...data } = request;
const response = await httpClient.patch(`/epigrams/${id}`, data);
return response.data;
};

export const toggleEpigramLike = async (request: EpigramRequestType): Promise<GetEpigramResponseType> => {
const { id } = request;

if (id === undefined) {
throw new Error('Epigram ID๊ฐ€ ์ œ๊ณต๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.');
}

try {
const response = await httpClient.post(`/epigrams/${id}/like`);
return response.data;
} catch (error) {
if (axios.isAxiosError(error)) {
const axiosError = error as AxiosError;
if (axiosError.response?.status === 400) {
// ์ด๋ฏธ ์ข‹์•„์š”๋ฅผ ๋ˆŒ๋ €๋‹ค๋ฉด, ์ข‹์•„์š” ์ทจ์†Œ ์š”์ฒญ์„ ๋ณด๋ƒ…๋‹ˆ๋‹ค.
const response = await httpClient.delete(`/epigrams/${id}/like`);
return response.data;
}
// ๊ทธ ์™ธ์˜ ์—๋Ÿฌ ์ฒ˜๋ฆฌ
if (axiosError.response) {
throw new Error(`API ์—๋Ÿฌ: ${axiosError.response.status}`);
} else if (axiosError.request) {
throw new Error('์„œ๋ฒ„๋กœ๋ถ€ํ„ฐ ์‘๋‹ต์„ ๋ฐ›์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค.');
} else {
throw new Error('์š”์ฒญ ์„ค์ • ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.');
}
} else {
throw new Error('์˜ˆ์ƒ์น˜ ๋ชปํ•œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.');
}
}
};
27 changes: 25 additions & 2 deletions src/apis/queries.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { createQueryKeyStore } from '@lukemorales/query-key-factory';
import { GetUserRequestType } from '@/schema/user';
import { EpigramRequestType } from '@/schema/epigram';
import { CommentRequestType } from '@/schema/comment';
import { GetMonthlyEmotionLogsRequestType } from '@/schema/emotion';
import { getMe, getUser } from './user';
import { getEpigram } from './epigram';
import { getEpigramComments } from './epigramComment';
import getMonthlyEmotionLogs from './emotion';

const quries = createQueryKeyStore({
const queries = createQueryKeyStore({
user: {
getMe: () => ({
queryKey: ['getMe'],
Expand All @@ -15,6 +19,25 @@ const quries = createQueryKeyStore({
queryFn: () => getUser(request),
}),
},
// NOTE: Epigram ๊ด€๋ จ queryํ•จ์ˆ˜
epigram: {
getEpigram: (request: EpigramRequestType) => ({
queryKey: ['epigram', request.id, request],
queryFn: () => {
if (request.id === undefined) {
throw new Error('Epigram ID๊ฐ€ ์ œ๊ณต๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.');
}
return getEpigram(request);
},
enabled: request.id !== undefined,
}),
},
epigramComment: {
getComments: (request: CommentRequestType) => ({
queryKey: ['epigramComments', request],
queryFn: () => getEpigramComments(request),
}),
},
emotion: {
getMonthlyEmotionLogs: (request: GetMonthlyEmotionLogsRequestType) => ({
queryKey: ['getMonthlyEmotionLogs', request],
Expand All @@ -23,4 +46,4 @@ const quries = createQueryKeyStore({
},
});

export default quries;
export default queries;
Loading

0 comments on commit 52b7c9e

Please sign in to comment.