Skip to content

Commit

Permalink
refactor(fixture): fixture directory로 mocks data 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubinquitous committed Aug 15, 2023
1 parent 98f9329 commit 8854351
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/assets/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ export { default as emptyCategories } from "./emptyCategories";
export { default as emptyClassInfo } from "./emptyClassInfo";
export { default as emptyClassLevel } from "./emptyClassLevel";
export { default as emptyTimetable } from "./emptyTimetable";
export { default as emptyPostList } from "./emptyPostList";
2 changes: 2 additions & 0 deletions src/fixture/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as post } from "./post";
export { default as postList } from "./postList";
4 changes: 2 additions & 2 deletions src/assets/data/emptyPost.ts → src/fixture/post.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IPost } from "@/interfaces";

const emptyPost: IPost = {
const post: IPost = {
id: 0,
user: {
code: 0,
Expand All @@ -15,4 +15,4 @@ const emptyPost: IPost = {
totalLikes: 0,
};

export default emptyPost;
export default post;
4 changes: 2 additions & 2 deletions src/assets/data/emptyPostList.ts → src/fixture/postList.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PostListType } from "@/types";

const emptyPostList: PostListType = [
const postList: PostListType = [
{
id: 0,
user: {
Expand All @@ -16,4 +16,4 @@ const emptyPostList: PostListType = [
},
];

export default emptyPostList;
export default postList;
2 changes: 1 addition & 1 deletion src/page/forum-post/layouts/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import styled from "styled-components";
import { useRouter } from "next/navigation";
import { ROUTER } from "@/constants";
import { color } from "@/styles";
import emptyPost from "@/assets/data/emptyPost";
import { IPost } from "@/interfaces";
import { post as emptyPost } from "@/fixture";
import PostBody from "./PostBody";
import PostHead from "./PostHead";
import { usePostQuery } from "../services/query.service";
Expand Down
2 changes: 1 addition & 1 deletion src/page/forum/layouts/Forum.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from "react";
import styled from "styled-components";
import { emptyPostList } from "@/assets/data";
import { KEY } from "@/constants";
import { useQueryClient } from "react-query";
import { PostListType } from "@/types";
import { useRecoilValue } from "recoil";
import { categoriesStore } from "@/store/categories.store";
import { forumFilterStore } from "@/store/forumType.store";
import { postList as emptyPostList } from "@/fixture";
import ForumFilter from "./ForumFilter";
import Categories from "./Categories";
import PostList from "./PostList";
Expand Down

0 comments on commit 8854351

Please sign in to comment.