-
카테고리
-
세부 분야
풀스택
부모가있는 동적페이지 백엔드 질문
20.04.28 15:49 작성 조회수 43
0
삭제된 글입니다
답변을 작성해보세요.
0
0
0
0
0
지니
질문자2020.04.28
// 게시물 로드하기
function loadMainPostsAPI(gpostId,title) { // http://localhost:3060/post/100/개발자
return axios.get(`/posts/${gpostId}/${title}`);
}
function* loadMainPosts() {
try {
const result = yield call(loadMainPostsAPI, action.data, action.data.gpostId, action.data.title);
yield put({
type: LOAD_MAIN_POSTS_SUCCESS,
data: result.data,
});
} catch (e) {
yield put({
type: LOAD_MAIN_POSTS_FAILURE,
error: e,
});
}
}
네 이렇게 수정해줬는데 여전히 불러오지 못하고있네요,, < post.js /routes >, < posts.js /routes > 에서
GpostId가 있는 게시물 불러오기, 게시물올리기 코드는 저렇게 하면 되는건가요??
0
0
지니
질문자2020.04.28
function* addPost(action) {
try {
const result = yield call(addPostAPI, action.data, action.data.gpostId, action.data.title);
yield put({
type: ADD_POST_SUCCESS,
data: result.data,
});
console.error(e);
} catch (e) {
yield put({
type: ADD_POST_FAILURE,
error: e,
});
}
}
답변감사합니다 이렇게 수정하란 말씀이신가요?
0
0
조현영
지식공유자2020.04.28
function loadMainPostsAPI(gpos tId) { // http://localhost: 3060/post/100/개발자
return axios.get(`/posts/$ {gpostId}/${title}`);
}
function* loadMainPosts() {
try {
const result = yield cal l(loadMainPostsAPI);
답변 9