Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/api/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const getTodoDetail = async (memberId: number) => {

export const addFavoriteFromOther = async (todoId: number) => {
const result = await fetchClient.post<TodoFavoriteFromOtherResponse>(
API_URL.addTodoFromArchived('SAVE'),
API_URL.addTodoFromArchived('FAVORITE'),
{ body: { todoId } },
);

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/FavoriteTab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const FavoriteTab = ({ todoType, planId }: FavoriteTabProps) => {
const openAddBottomSheet = useAddTodoBottomSheet({ todoType, planId });
const openEditBottomSheet = useEditTodoBottomSheet({ todoType });

const isFavoritePage = todoType === TODO_TYPE.SAVE;
const isFavoritePage = todoType === TODO_TYPE.FAVORITE;

const handleAddTodoFromFavorite = (todoId: number) => {
addTodoFromArchived(
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/TodoTab/TodoTab.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export const TODO_TAB_TEXT = {
TODAY: `오늘 할 일, 작은 목표로 시작해봐요\n최대 ${MAX_TODO_ITEM_LENGTH}개까지 고를 수 있어요`,
TOMORROW: `내일 할 일, 작은 목표로 시작해봐요\n최대 ${MAX_TODO_ITEM_LENGTH}개까지 고를 수 있어요`,
PATH: '이 구간에서 할 일을 골라보세요',
SAVE: '즐겨찾기에 추가할 할 일을 골라보세요',
FAVORITE: '즐겨찾기에 추가할 할 일을 골라보세요',
} as const;
2 changes: 1 addition & 1 deletion frontend/src/constants/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const USER_STATUS = {
export const TODO_TYPE = {
TODAY: 'TODAY',
TOMORROW: 'TOMORROW',
SAVE: 'SAVE',
FAVORITE: 'FAVORITE',
PATH: 'PATH',
} as const;

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/constants/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const DATE_TEXT = {
TODAY: '오늘',
TOMORROW: '내일',
PATH: '',
SAVE: '',
FAVORITE: '',
};

export const TODO_TOAST_MESSAGE = {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/constants/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const API_URL = {
// 할 일
todayTodo: `${BASE_URL}/api/v1/todos/today`,
tomorrowTodo: `${BASE_URL}/api/v1/todos/tomorrow`,
favoriteTodo: (queryParams: string) => `${BASE_URL}/api/v1/todos/save${queryParams}`,
favoriteTodo: (queryParams: string) => `${BASE_URL}/api/v1/todos/favorite${queryParams}`,
recommendLimitTodo: (modifyType: TodoType, planId?: number) =>
`${BASE_URL}/api/v1/todos/recommend/personalized?modifyType=${modifyType}${planId ? `&pathId=${planId}` : ''}`,
recommendAllTodo: (queryParams: string) => `${BASE_URL}/api/v1/todos/recommend/all${queryParams}`,
Expand Down Expand Up @@ -74,7 +74,7 @@ export const MOCK_API_URL = {
// 할 일
todayTodo: `${BASE_URL}/api/v1/todos/today`,
tomorrowTodo: `${BASE_URL}/api/v1/todos/tomorrow`,
favoriteTodo: `${BASE_URL}/api/v1/todos/save`,
favoriteTodo: `${BASE_URL}/api/v1/todos/favorite`,
recommendLimitTodo: `${BASE_URL}/api/v1/todos/recommend/personalized`,
recommendAllTodo: `${BASE_URL}/api/v1/todos/recommend/all`,
addTodo: `${BASE_URL}/api/v1/todos/:todoType/manual`,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/mocks/handlers/todo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const addTodoHandler = async ({
});

return HttpResponse.json(newTodo);
} else if (requestParams.todoType === 'SAVE') {
} else if (requestParams.todoType === 'FAVORITE') {
/** 즐겨찾기 */
FAVORITE_TODO.data.push({
...newTodo,
Expand Down Expand Up @@ -272,7 +272,7 @@ const addTodoFromArchivedHandler = async ({
applyCheckStatus(newTodo);

return HttpResponse.json(newTodo);
} else if (requestParams.todoType === 'SAVE') {
} else if (requestParams.todoType === 'FAVORITE') {
/** 즐겨찾기 */
const newTodo = getNewTodo(todoId);

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/FavoritePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const FavoritePage = () => {
))}
</S.TabList>
<S.TabContent>
<FavoriteTab todoType={TODO_TYPE.SAVE} />
<FavoriteTab todoType={TODO_TYPE.FAVORITE} />
<RecommendTodoContainer isFavoritePage />
</S.TabContent>
</Tab.Root>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const useAddFavoriteFromOther = () => {

return useMutation({
mutationFn: ({ todoId, memberId }: { todoId: number; memberId: number }) => {
return addTodoFromArchived('SAVE', todoId);
return addTodoFromArchived('FAVORITE', todoId);
},
onSuccess: (_, { memberId }) => {
queryClient.invalidateQueries({ queryKey: [QUERY_KEY.detailTodo, memberId] });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const getTodoType = ({ planId, isFavoritePage, dateType }: GetTodoTypePar
if (planId) {
return TODO_TYPE.PATH;
} else if (isFavoritePage) {
return TODO_TYPE.SAVE;
return TODO_TYPE.FAVORITE;
}

return dateType;
Expand Down