Skip to content

Commit 16a02b9

Browse files
authored
Merge branch 'develop' into feat/#290/filter-ssr
2 parents 428a065 + 5554bbf commit 16a02b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+612
-648
lines changed

index.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,5 @@
5151

5252
<div id="root"></div>
5353
<script type="module" src="/src/main.tsx"></script>
54-
<script
55-
type="text/javascript"
56-
src="https://oapi.map.naver.com/openapi/v3/maps.js?ncpClientId=%VITE_NAVER_API_KEY%"></script>
5754
</body>
5855
</html>

next.config.ts

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,31 @@ const withVanillaExtract = createVanillaExtractPlugin();
55

66
const nextConfig: NextConfig = {
77
reactStrictMode: true,
8+
89
images: {
9-
domains: ['noms.templestay.com'],
10+
domains: ['noms.templestay.com', 'www.templestay.com'],
1011
},
12+
1113
webpack(config) {
12-
config.module.rules.push({
13-
test: /\.svg$/,
14-
issuer: /\.[jt]sx?$/,
15-
use: [
16-
{
17-
loader: '@svgr/webpack',
18-
options: {
19-
memo: true,
20-
},
21-
},
22-
],
23-
});
14+
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.('.svg'));
15+
16+
config.module.rules.push(
17+
{
18+
...fileLoaderRule,
19+
test: /\.svg$/i,
20+
resourceQuery: /url/,
21+
},
22+
23+
{
24+
test: /\.svg$/i,
25+
issuer: fileLoaderRule.issuer,
26+
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] },
27+
use: ['@svgr/webpack'],
28+
},
29+
);
30+
31+
fileLoaderRule.exclude = /\.svg$/i;
32+
2433
return config;
2534
},
2635
};

src/apis/instance.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import API_URL from '@apis/env';
24
import MESSAGES from '@apis/messages';
35
import { getStorageValue } from '@hooks/useLocalStorage';

src/apis/ranking/axios.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import { getAxiosInstance } from '@apis/instance';
1+
import instance from '@apis/instance';
22

3-
const getRanking = async (userId: number | null) => {
4-
const axiosInstance = getAxiosInstance();
3+
const getRanking = async () => {
4+
const res = await instance.get('/v2/api/templestay/recommendation');
55

6-
const res = await axiosInstance.get('/ranking', {
7-
params: { userId },
8-
});
96
return res.data;
107
};
118

src/apis/ranking/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import getRanking from '@apis/ranking/axios';
22
import { RankingResponse } from '@apis/ranking/type';
3+
import { ApiResponse } from '@apis/response';
34
import { useQuery } from '@tanstack/react-query';
45

5-
const useGetRanking = (userId: number | null) => {
6-
const { data, isLoading, isError } = useQuery<RankingResponse>({
7-
queryKey: ['ranking', userId],
8-
queryFn: () => getRanking(userId),
6+
const useGetRanking = () => {
7+
const { data, isLoading, isError } = useQuery({
8+
queryKey: ['ranking'],
9+
queryFn: () => getRanking(),
10+
select: (res: ApiResponse<RankingResponse>) => res.data.recommendTemplestays,
911
});
1012

1113
return { data, isLoading, isError };

src/apis/ranking/type.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
// api 관련 interface 및 type 정리
2-
31
export interface Temple {
4-
ranking: number;
5-
templestayId: number;
6-
templeName: string;
7-
tag: string;
8-
region: string;
9-
liked: boolean;
2+
id: number;
3+
rank: number;
4+
templestayName: string;
105
imgUrl: string;
6+
region: string;
7+
templeName: string;
8+
wish: boolean;
119
}
1210

1311
export interface RankingResponse {
14-
rankings: Temple[];
12+
recommendTemplestays: Temple[];
1513
}

src/apis/templeDetail/axios.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/apis/templeDetail/index.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/apis/templeDetail/type.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/apis/templeImages/axios.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)