-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feat/Map-Yorkie
- Loading branch information
Showing
72 changed files
with
1,284 additions
and
891 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { useMutation } from 'react-query'; | ||
import instance from '../instance'; | ||
import { BaseResponse } from '../../types/BaseResponse'; | ||
import { LoginSuccess } from '../../types/auth/login'; | ||
import { ResponseCode } from '../../types/enum/ResponseCode'; | ||
import useRegisterStore from '../../stores/registerStore'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
export const useLogOutMutation = (prevUrl: string) => { | ||
const { resetStatus } = useRegisterStore(); | ||
const navigate = useNavigate(); | ||
|
||
const mutation = useMutation({ | ||
mutationFn: async () => { | ||
return await instance.post<BaseResponse<LoginSuccess>>(`/logout`); | ||
}, | ||
onSuccess: (response) => { | ||
const respone = response.data; | ||
|
||
if (respone.code === ResponseCode.SUCCESS) { | ||
resetStatus(); | ||
} | ||
navigate(prevUrl); | ||
}, | ||
onError: () => { | ||
console.log('로그아웃 실패'); | ||
navigate(prevUrl); | ||
}, | ||
}); | ||
|
||
return mutation; | ||
}; | ||
|
||
export default useLogOutMutation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import instance from "../instance"; | ||
import { FollowType } from "../../types/follow/FollowType"; | ||
|
||
export const unFollow = async (follow: FollowType): Promise<FollowType> => { | ||
const { followingId } = follow; | ||
|
||
console.log(follow); | ||
|
||
try { | ||
const result = await instance.delete(`/unfollow`, { | ||
params: { followingId } | ||
}); | ||
|
||
console.log(result); | ||
|
||
// Axios의 응답 객체에서 실제 데이터를 추출하여 반환 | ||
return result.data as FollowType; | ||
|
||
} catch (error) { | ||
console.error("Unfollow request failed", error); | ||
throw error; // 에러가 발생한 경우 상위로 전달 | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { useMutation, useQueryClient } from "react-query"; | ||
import { unFollow } from "./unFollow"; | ||
import { FollowType } from "../../types/follow/FollowType"; | ||
|
||
export const useDeleteUnFollow = () => { | ||
const queryClient = useQueryClient(); | ||
|
||
const mutation = useMutation({ | ||
mutationFn: async (follow: FollowType) => { | ||
console.log(follow) | ||
return await unFollow(follow) | ||
}, | ||
onSuccess: () => { | ||
queryClient.invalidateQueries({ queryKey : ['unfollowData']}); | ||
}, | ||
onError: (error :Error) => { | ||
console.log('Unfollow request failed', error); | ||
}, | ||
}); | ||
|
||
return mutation; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { searchMap } from "./searchMap"; | ||
|
||
export const getSearchMap = async (searchType:string, searchWord:string,size: number, page:number) => { | ||
try{ | ||
const response = await searchMap(searchType,searchWord,size,page); | ||
return response; | ||
} catch (error) { | ||
console.error('Error fetching random map:',error); | ||
return undefined; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import instance from "../instance"; | ||
import { BaseResponse } from "../../types/BaseResponse"; | ||
import { APIExploreMapType } from "../../types/mapData/APIExploreMapType "; | ||
import { KeywordType } from "../../types/keywords/KeywordType"; | ||
|
||
export const searchMap = async (searchType: string, searchWord:string,size:number,page:number) => { | ||
try { | ||
const response = await instance.get<BaseResponse<APIExploreMapType[] | undefined>> (`/map/search`, { | ||
params: { | ||
searchType, | ||
searchWord, | ||
size, | ||
page | ||
} | ||
}) | ||
|
||
const results = response.data.result?.map((item) => { | ||
const newKeyword : KeywordType[]= item.keyword.map((title: string, index) => ({ | ||
id: index, | ||
title: title, | ||
selected: false, | ||
})); | ||
return { | ||
...item, | ||
keyword: newKeyword, | ||
}; | ||
}); | ||
|
||
return results; | ||
} catch(error) { | ||
console.error('Error fetchgin data:',error); | ||
return undefined; | ||
} | ||
} |
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
.errorPageRoot { | ||
width: 1382px; | ||
height: 855px; | ||
width: 100%; | ||
height: calc(100vh - 181px); | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
text-align: center; /* 텍스트를 중앙 정렬 */ | ||
} | ||
|
||
.text { | ||
color: #767d86; | ||
font-size: 18px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 150%; | ||
text-align: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.