Skip to content

Commit

Permalink
Feat : 리스트 생성 페이지 구현 및 API 연결 (#16)
Browse files Browse the repository at this point in the history
* Feat: 리스트생성 다음 버튼 활성화 기능

* Feat: 템플릿으로 리스트 바로 생성 기능

* Feat: 리스트 생성 API 연결

* Feat: 리스트 생성 구현 및 컴포넌트 분리

* Feat: 이미지 요청, 리스트생성 요청 데이터  분리

* HOTFIX: CI test 빌드에러 해결 - 파일명 대소문자 다름 이슈

* Refactor: 서영님 리뷰 반영 - error rules 상 수화 및 css 파일 디테일 수정
  • Loading branch information
Eugene-A-01 authored Feb 4, 2024
1 parent 450c256 commit 62ae89d
Show file tree
Hide file tree
Showing 44 changed files with 1,124 additions and 797 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_BASE_URL = "https://dev.api.listywave.com"
2 changes: 1 addition & 1 deletion src/app/[userNickname]/collabolist/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- [ ] 반응형 UI 구현
*/

import '@/styles/globalStyles.css';
import '@/styles/GlobalStyles.css';

import { USER_DATA_ME } from '../mockData/user'; // 삭제 예정

Expand Down
2 changes: 1 addition & 1 deletion src/app/[userNickname]/mylist/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- [ ] 반응형 UI 구현
*/

import '@/styles/globalStyles.css';
import '@/styles/GlobalStyles.css';

import { USER_DATA_ME } from '../mockData/user'; // 삭제 예정

Expand Down
4 changes: 2 additions & 2 deletions src/app/_api/category/getCategories.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import axiosInstance from '@/lib/axios/axiosInstance';
import { CategoriesType } from '@/lib/types/categoriesType';
import { CategoryType } from '@/lib/types/categoriesType';

export const getCategories = async () => {
const response = await axiosInstance.get<CategoriesType>('/categories');
const response = await axiosInstance.get<CategoryType[]>('/categories');

return response.data;
};
9 changes: 8 additions & 1 deletion src/app/_api/list/createList.ts
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
// 리스트 생성 api
import axiosInstance from '@/lib/axios/axiosInstance';
import { ListCreateType } from '@/lib/types/listType';

export const createList = async (data: ListCreateType) => {
const response = await axiosInstance.post<ListCreateType>('/lists', data);

return response.data;
};
8 changes: 8 additions & 0 deletions src/app/_api/user/getUsers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import axiosInstance from '@/lib/axios/axiosInstance';
import { UserProfilesType } from '@/lib/types/userProfileType';

export const getUsers = async () => {
const response = await axiosInstance.get<UserProfilesType>('/users');

return response.data;
};
9 changes: 4 additions & 5 deletions src/app/create/_components/CreateItem.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { useFormContext } from 'react-hook-form';

import BackIcon from '/public/icons/back.svg';
import Items from './Items';
import Items from './item/Items';
import * as styles from './CreateItem.css';

interface CreateItemProps {
onBackClick: () => void;
onSubmit: () => void;
}

export default function CreateItem({ onBackClick }: CreateItemProps) {
export default function CreateItem({ onBackClick, onSubmit }: CreateItemProps) {
const {
formState: { isValid },
} = useFormContext();
Expand All @@ -21,9 +22,7 @@ export default function CreateItem({ onBackClick }: CreateItemProps) {
</button>
<h1 className={styles.headerTitle}>리스트 생성</h1>
<button
onClick={() => {
console.log('제출');
}}
onClick={onSubmit}
className={isValid ? styles.headerNextButton : styles.headerNextButtonDisabled}
disabled={!isValid ? true : false}
>
Expand Down
Loading

0 comments on commit 62ae89d

Please sign in to comment.