Skip to content

Commit

Permalink
[Feat]:큐레이션 목록 api 기본 구현 #35
Browse files Browse the repository at this point in the history
  • Loading branch information
Cho-yunah committed Nov 29, 2022
1 parent c12c312 commit 7c8aa17
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/apis/curation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// import { BarType } from '@lib/types';
import RestAPI from './restapi';

class CurationAPI {
/**
* 술집 목록 조회
* @param latitude
* @param longitude
*/
public async getCurationList(data) {
try {
const { latitude, longitude } = data;
const result = await RestAPI.get(`/api/curation?regionId={regionId}&offset={offset}&limit={limit}`);
return result.data;
} catch (error) {
console.log(error);
}
}
}

export default new CurationAPI();
2 changes: 2 additions & 0 deletions src/apis/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { default as user } from './users';
import { default as bar } from './bar';
import { default as curation } from './curation';

const apis = {
user,
bar,
curation,
};

export default apis;
4 changes: 4 additions & 0 deletions src/pages/curation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import styled from 'styled-components';
import { BottomMenu, Box, CommonWrapper } from '@components/common';
import { CurationItem } from '@components/pages/curation';
import { useRouter } from 'next/router';
import useGeoloaction from '@hooks/common/useGetCurrentLocation';

function Curation() {
const router = useRouter();
const { location } = useGeoloaction();

const handleClick = () => {
router.push('/curation/detail/info');
Expand All @@ -31,6 +33,7 @@ export default Curation;

const Wrapper = styled(CommonWrapper)`
padding: 20px;
background-color: #fff;
h1 {
margin: 30px 0;
Expand All @@ -40,6 +43,7 @@ const Wrapper = styled(CommonWrapper)`
padding: 15px;
height: 100%;
overflow: auto;
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
Expand Down

0 comments on commit 7c8aa17

Please sign in to comment.