ckdwls25250839
@ckdwls25250839
Reviews Written
-
Average Rating
-
Posts
Q&A
ios ์๋ฎฌ๋ ์ดํฐ๊ฐ ๊บผ์ง๋๋ค
xcode์์ ๋น๋ํ๊ณ ์คํ ํด๋ณด๋ (์ฌ์ง) 'cyclone' is not a recognized processor for this target (ignoring processor) ๋ค์ ๊ฐ์ ์๋ฌ๊ฐ ๋น๋๋ค...๊ตฌ๊ธ๋ง์ ํด๋ดค๋๋ฐ m1๋ฌธ์ ๋ผ๊ณ ํ๋๊ฑฐ ๊ฐ์๋ฐ...ํน์ ํด๊ฒฐ์ฑ ์ ์๊ณ ๊ณ์ค๊ฐ์?
- 0
- 3
- 559
Q&A
npm run android๊ฐ ์๊พธ ์๋ฌ๊ฐ ์๊น๋๋ค....
์๋ฐ ์ญ์ ํ๋ค์ 11๋ฒ์ ์ผ๋ก ์๋ก ์ค์นํ๊ณ , ๊ฒฝ๋ก๋ ๋ฐ๊พธ๋ ์คํ๋ฉ๋๋ค!!! ๋น ๋ฅธ ๋ต๋ณ ์ฃผ์ ์ ์ ๋ง ๊ฐ์ฌํฉ๋๋ค^^
- 0
- 2
- 674
Q&A
sagas๋ถ๋ถ์ addPost์์ addPostAPI๋ฅผ ๋ชป๋ถ๋ฌ์์...
console.error(e) ํ๋๊น ์๋ชป๋ ๋ถ๋ถ์ด call์ ํธ์ถ ํ์ง ์์์๋ค์ใ ใ ....์๋ฌ๋๊ณณ์ ๋ก๊ทธ๋ฅผ ์ฐ์ด๋ณธ๋ค๋๊ฑธ ์๊ฐ ๋ชปํ์ต๋๋ค ใ ใ ์ ๋ง ๊ฐ์ฌํฉ๋๋ค ์ ๋ก์ด๋!!!
- 0
- 4
- 397
Q&A
sagas๋ถ๋ถ์ addPost์์ addPostAPI๋ฅผ ๋ชป๋ถ๋ฌ์์...
๋คํธ์ํฌํญ ๋ถ๋ถ์ ๋๋ค. (์ฌ์ง)--------------------------- components์ UserProfile ๋ถ๋ถ์ ๋๋ค. const PostForm = () => { const dispatch = useDispatch(); const [text, setText] = useState(""); const { imagePaths, isAddingPost, postAdded } = useSelector( state => state.post ); useEffect(() => { setText(""); }, [postAdded === true]); const onSubmitForm = useCallback( e => { e.preventDefault(); if (!text || !text.trim()) { return alert("๊ฒ์๊ธ์ ์์ฑํ์ธ์."); } console.log("PostForm"); dispatch({ type: ADD_POST_REQUEST, data: { content: text.trim() } }); }, [text] ); const onChangeText = useCallback(e => { setText(e.target.value); }, []); --------------------------- sagas/post์ addpost ๋ถ๋ถ 3์ข ์ ํธ์ ๋๋ค. function addPostAPI(postData) { console.log("addPostAPI"); return axios.post("/post/", postData, { withCredentials: true });}function* addPost(action) { try { console.log("addPost1"); const result = yield call(addPostAPI, action.data); console.log("addPost2"); yield put({ type: ADD_POST_SUCCESS, data: result.data }); } catch (e) { yield put({ type: ADD_POST_FAILURE, error: e }); }}function* watchAddPost() { console.log("watchAddPost"); yield takeLatest(ADD_POST_REQUEST, addPost);} --------------------------- back/routes/post ๋ถ๋ถ์ ๋๋ค. router.post('/', async (req, res, next) => { // POST /api/post try { const hashtags = req.body.content.match(/#[^\s]+/g); const newPost = await db.Post.create({ content: req.body.content, // ex) '์ ๋ก์ด ํ์ดํ #๊ตฌ๋ #์ข์์ ๋๋ฌ์ฃผ์ธ์' UserId: req.user.id, }); if (hashtags) { const result = await Promise.all(hashtags.map(tag => db.Hashtag.findOrCreate({ where: { name: tag.slice(1).toLowerCase() }, }))); console.log(result); await newPost.addHashtags(result.map(r => r[0])); } // const User = await newPost.getUser(); // newPost.User = User; // res.json(newPost); const fullPost = await db.Post.findOne({ where: { id: newPost.id }, include: [{ model: db.User, }], }); res.json(fullPost); } catch (e) { console.error(e); next(e); }}); --------------------------- ํน์ ๋ชฐ๋ผ์ ์ง๊ธ ์ค๋ฅ๋ ๊น ํ๋ธ ์ฃผ์ ์ ๋๋ค. https://github.com/park-chang-jin/react_nodebird (ch5_1 ๋ถ๋ถ์ด ์ค๋ฅ๋ ๊ณณ์ ๋๋ค)
- 0
- 4
- 397
Q&A
ํ๋ก ํธ์๋ฒ์์ ๋ฐฑ์ค๋ ์๋ฒ๋ก ๋ชป๊ฐ๋๊ฑฐ ๊ฐ์์
ํ ์ด๋ธ์ ๋ค์ ๋ง๋๋ ํด๊ฒฐ ๋ซ์ด์ ใ ใ ์ ๋ง ๊ฐ์ฌํฉ๋๋ค!!!
- 0
- 2
- 343




