-
Notifications
You must be signed in to change notification settings - Fork 1
๐ fix: url ๊ฒฝ๋ก ์์ ๋ฐ post ์ปดํฌ๋ํธ ์์ #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
โฆnto fix/132-url
Moon-ju-young
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๊ณ ํ์ จ์ต๋๋ค! ํน์ ๊ฐ๋ฅํ๋ค๋ฉด StoreForm ๋ด๋ถ์ ๊ฒฝ๋ก ์ด๋๋ ์์ ํด์ฃผ์ค ์ ์์ผ์ค๊น์?
| const isOwnerPage = location.pathname.startsWith('/owner'); | ||
|
|
||
| const path = isOwnerPage | ||
| ? `/owner/post/${shopId}/${noticeId}` | ||
| : `/${shopId}/${noticeId}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐ฌ ์ด๋ ๊ฒ ๋๋ค๋ฉด ํ์ฌ ์ฌ์ฅ ํ์ด์ง์ ์๋ค๊ฐ ๋ค๋ฅธ notice ๊ฒฝ๋ก๋ฅผ ์น๊ณ ๋ค์ด๊ฐ๋ฉด ๋จ์ ์ง์ ๋ชฉ๋ก์ด ํฌํจ๋ ๊ณต๊ณ ์์ธ ํ์ด์ง๋ฅผ ๋ณผ ์ ์์ง ์์๊น์? ๊ฐ์ฅ ์ข์ ๋ฐฉ๋ฒ์ userId๋ฅผ ๊ฐ์ง๊ณ ๊ถํ?์ ํ๋จํ๋ ๋ฐฉ๋ฒ์ด๊ฒ ์ง๋ง ์ด๋ ค์ธ ๊ฑฐ ๊ฐ์์... ๊ทธ๋ฅ ์ธ๋ถ์์ ์ด๋ํ ๊ฒฝ๋ก๋ฅผ ์ปจํธ๋กค ํ๊ฑฐ๋ ํ๋ ๊ฒ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ทธ์ผ ์ด๊ฑฐ๋ post ์ปดํฌ๋ํธ ํด๋ฆญ ์ด๋ฒคํธ๋ผ ์ง์ ์ฃผ์๋ฅผ ์น๊ณ ๊ฐ๋ ๋์์ ๊ด๋ จ์ด ์๊ณ ,
๋ง์ํ์ ๋ถ๋ถ์ ํด๋น ํ์ด์ง ๋ด์์ ์ฒ๋ฆฌํ๋๊ฒ ๋ง์ ๊ฒ ๊ฐ์ต๋๋ค.
src/components/common/Post.tsx
Outdated
| <div | ||
| onClick={handleClick} | ||
| className="flex h-261 w-full cursor-pointer flex-col gap-12 rounded-xl border border-gray-20 bg-white p-12 md:h-359 md:gap-20 md:p-16 lg:h-348" | ||
| > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐ฌ ํด๋ฆญ event๊ฐ ์๋ ๊ฒฝ์ฐ button์ด ๋ ๋ซ์ง ์์๊น์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ง์ต๋๋ค ์์ ํ์ต๋๋ค~!
๐ ๋ณ๊ฒฝ ์ฌํญ ๊ฐ์
ํ์ฌ ๊ณต๊ณ ์์ธ ํ์ด์ง์ ๊ฒฝ๋ก์ noticeId๋ง ํฌํจ๋์ด ์๋๋ฐ, shopId๋ ํฌํจ์์ผฐ์ต๋๋ค.
post ์ปดํฌ๋ํธ๋ฅผ ํด๋ฆญ ์ ํด๋น ๊ณต๊ณ ์์ธ ํ์ด์ง๋ก ์ด๋ํ๋๋ก onClick์์ฑ ์ถ๊ฐํ์ต๋๋ค.
๐ ์์ธ ๋ด์ฉ
๐ ๊ด๋ จ ์ด์
๐ผ๏ธ ์คํฌ๋ฆฐ์ท(์ ํ์ฌํญ)
๐ก ์ฐธ๊ณ ์ฌํญ
๊ณต๊ณ ์์ธ ํ์ด์ง๊ฐ 2๊ฐ์ธ๋ฐ, ๋ด ๊ฐ๊ฒ์ ๊ณต๊ณ ์ผ ๊ฒฝ์ฐ์ ์ด๋ป๊ฒ ๋ด ๊ฐ๊ฒ ๊ณต๊ณ ์์ธ ํ์ด์ง๋ก ์ด๋์ํฌ ์ง ๊ณ ๋ฏผ์ ํ๋๋ฐ, /owner๋ก ์์ํ๋ ๊ฒฝ๋ก๋ ๋ด ๊ฐ๊ฒ์ ๋ํ ํ์ด์ง๋ค์ด๋ฏ๋ก,
/owner๋ก ์์ํ๋ ํ์ด์ง์์ post๋ฅผ ํด๋ฆญ ์ ๋ด ๊ฐ๊ฒ ๊ณต๊ณ ์์ธ ํ์ด์ง๋ก ์ด๋ํ๋ฉฐ,
๋๋จธ์ง ๊ฒฝ์ฐ(๊ณต๊ณ ๋ฆฌ์คํธ ํ์ด์ง)์์๋ ๊ณต๊ณ ์์ธ ํ์ด์ง๋ก ์ด๋ํ๋๋ก ํ์ต๋๋ค.