From 2c49b39c94f98217425bf74fcffd4323c56f9048 Mon Sep 17 00:00:00 2001 From: JeongTaehwan Date: Fri, 1 Jul 2022 10:09:27 +0900 Subject: [PATCH] =?UTF-8?q?Update=20:=20Api=20=EB=B3=80=EA=B2=BD=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B8=ED=95=9C=20=EC=9D=B8=EC=88=98=20=EA=B0=92?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Components/Post/Post.tsx | 10 +++++----- src/Components/PostItem/PostItem.stories.tsx | 4 ++-- src/Components/PostItem/PostItem.tsx | 8 ++++---- src/Components/Write/WriteTextForm.tsx | 2 +- src/Lib/Api/post/post.ts | 12 ++++++------ 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Components/Post/Post.tsx b/src/Components/Post/Post.tsx index 54c2da0b..c641a131 100644 --- a/src/Components/Post/Post.tsx +++ b/src/Components/Post/Post.tsx @@ -25,7 +25,7 @@ import { disconnect } from "process"; export type post = { boardId: number; - image_url: string; + imageUrl: string; status: string; title: string; }; @@ -111,10 +111,10 @@ const Post = () => {
{isTagSearched - ? contents.map(({ boardId, image_url, status, title }, idx) => ( + ? contents.map(({ boardId, imageUrl, status, title }, idx) => ( { /> )) : contents.map( - ({ boardId, image_url, status, title }: post, idx: number) => ( + ({ boardId, imageUrl, status, title }: post, idx: number) => ( = () => ( ); diff --git a/src/Components/PostItem/PostItem.tsx b/src/Components/PostItem/PostItem.tsx index 1c3dd1f9..3f0cca79 100644 --- a/src/Components/PostItem/PostItem.tsx +++ b/src/Components/PostItem/PostItem.tsx @@ -6,7 +6,7 @@ import * as I from "../../Assets/index"; type PostProps = { boardId: number; - image_url: string; + imageUrl: string; status: string; title: string; ref?: any; @@ -14,7 +14,7 @@ type PostProps = { const PostItem: React.FC = forwardRef( ( - { boardId, image_url, status, title }, + { boardId, imageUrl, status, title }, ref: React.LegacyRef, ) => { const navigate = useNavigate(); @@ -28,8 +28,8 @@ const PostItem: React.FC = forwardRef( >
{title} - {image_url ? ( - + {imageUrl ? ( + ) : ( )} diff --git a/src/Components/Write/WriteTextForm.tsx b/src/Components/Write/WriteTextForm.tsx index 27ddaea0..b5fde011 100644 --- a/src/Components/Write/WriteTextForm.tsx +++ b/src/Components/Write/WriteTextForm.tsx @@ -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(); diff --git a/src/Lib/Api/post/post.ts b/src/Lib/Api/post/post.ts index 4aed66ae..6e72deec 100644 --- a/src/Lib/Api/post/post.ts +++ b/src/Lib/Api/post/post.ts @@ -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,