Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Components/Post/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { disconnect } from "process";

export type post = {
boardId: number;
image_url: string;
imageUrl: string;
status: string;
title: string;
};
Expand Down Expand Up @@ -111,21 +111,21 @@ const Post = () => {
<TagSelector onSubmit={onSubmit} />
<div css={S.Container}>
{isTagSearched
? contents.map(({ boardId, image_url, status, title }, idx) => (
? contents.map(({ boardId, imageUrl, status, title }, idx) => (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아니 태환님 이거 왜 이렇게 작업하셨어요 진짜 비효율적이다

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

뉴진스의 하입보이요

<PostItem
boardId={boardId}
image_url={image_url}
imageUrl={imageUrl}
status={status}
title={title}
key={idx}
ref={pageEnd}
/>
))
: contents.map(
({ boardId, image_url, status, title }: post, idx: number) => (
({ boardId, imageUrl, status, title }: post, idx: number) => (
<PostItem
boardId={boardId}
image_url={image_url}
imageUrl={imageUrl}
status={status}
title={title}
key={idx}
Expand Down
4 changes: 2 additions & 2 deletions src/Components/PostItem/PostItem.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ export default {
const postObj = {
boardId: 1,
title: "PUZZLE",
image_url: "",
imageUrl: "",
status: "모집중",
};

export const postitem: ComponentStory<typeof PostItem> = () => (
<PostItem
boardId={postObj.boardId}
title={postObj.title}
image_url={postObj.image_url}
imageUrl={postObj.imageUrl}
status={postObj.status}
/>
);
8 changes: 4 additions & 4 deletions src/Components/PostItem/PostItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import * as I from "../../Assets/index";

type PostProps = {
boardId: number;
image_url: string;
imageUrl: string;
status: string;
title: string;
ref?: any;
};

const PostItem: React.FC<PostProps> = forwardRef(
(
{ boardId, image_url, status, title },
{ boardId, imageUrl, status, title },
ref: React.LegacyRef<HTMLDivElement>,
) => {
const navigate = useNavigate();
Expand All @@ -28,8 +28,8 @@ const PostItem: React.FC<PostProps> = forwardRef(
>
<div css={S.Container}>
<span css={S.Title}>{title}</span>
{image_url ? (
<img css={S.Image} src={image_url} />
{imageUrl ? (
<img css={S.Image} src={imageUrl} />
) : (
<I.DefaultImage css={S.Image} />
)}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Write/WriteTextForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const WriteTextForm: React.FC = () => {

const onLoadFile = async (e: any) => {
const formData = new FormData();
formData.append("files", e.target.files[0]);
formData.append("image", e.target.files[0]);
await axios.post(`${baseURL}/board/create-url`, formData).then((res) => {
setImageValue([...imageValue, res.data]);
innerRef.current.focus();
Expand Down
12 changes: 6 additions & 6 deletions src/Lib/Api/post/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ export const getDetailPost = async (

export const postBoard = async (
contents: string,
fieldList: string[] | string,
fields: string[] | string,
introduce: string,
languageList: string[] | string,
languages: string[] | string,
purpose: string,
status: string,
title: string,
fileUrlList?: string[],
imageUrls?: string[],
) => {
const { data } = await apiClient.post("/board", {
contents: contents,
fieldList: fieldList,
fileUrlList: fileUrlList,
fields: fields,
imageUrls: imageUrls,
introduce: introduce,
languageList: languageList,
languages: languages,
purpose: purpose,
status: status,
title: title,
Expand Down