-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* #16 레시피 보기 See: Github issue #16 --------------------------------------- ### 작업파일 * action/recipeAction.js * api -> recipeAPI.js, rootAPI.js * reducer -> recipeReducer.js, rootReducer.js * saga -> recipeSaga.js, rootSaga.js * ViewRecipe.jsx,scss --------------------------------------- ### 작업내용 * axios 사용을 위한 saga, redux 세팅 * action, api, saga, reducer 생성 * 서버에서 get 방식으로 body 를 받는 형태로 구현하여 파라미터로 받는거로 변경하기 전까지 작업 중단 * #15 레시피 등록 See: Github issue #15 --------------------------------------- ### 작업파일 * 등록 관련 파일들 * action, api, saga, reducer, container 아래 등록 관련 파일들 * 레시피 보기 관련 파일들 * HTML_TEST --------------------------------------- ### 작업내용 * 레시피 등록 api 연동 * api 이슈 해결 이후 레시피 보기에 맞게 컨버팅 * 테스트용 컴포넌트 삭제
- Loading branch information
Showing
25 changed files
with
582 additions
and
572 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export const actions = { | ||
ENROLMENT: { | ||
REQUEST: "ENROLMENT_REQUEST", | ||
SUCCESS: "ENROLMENT_SUCCESS", | ||
FAILED: "ENROLMENT_FAILED" | ||
} | ||
}; | ||
|
||
export function enrolmentRequest(data) { | ||
return { | ||
type: actions.ENROLMENT.REQUEST, | ||
payload: { | ||
data | ||
} | ||
}; | ||
} | ||
|
||
export function enrolmentSuccess(result) { | ||
return { | ||
type: actions.ENROLMENT.SUCCESS, | ||
payload: { | ||
result | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
export const actions = { | ||
ALL: { | ||
REQUEST: "VIEW_ALL", | ||
SUCCESS: "ALL_READ_SUCCESS", | ||
FAILED: "ALL_READ_FAILED" | ||
}, | ||
BYID: { | ||
REQUEST: "VIEW_BY_ID", | ||
SUCCESS: "BY_ID_READ_SUCCESS", | ||
FAILED: "BY_ID_READ_FAILED" | ||
}, | ||
TAGBYLATEST: { | ||
REQUEST: "VIEW_BY_TAG_LATEST", | ||
SUCCESS: "BY_TAG_LATEST_READ_SUCCESS", | ||
FAILED: "BY_TAG_LATEST_READ_FAILED" | ||
}, | ||
TAGBYVIEW: { | ||
REQUEST: "VIEW_BY_TAG_VIEW", | ||
SUCCESS: "BY_TAG_VIEW_READ_SUCCESS", | ||
FAILED: "BY_TAG_VIEW_READ_FAILED" | ||
}, | ||
STUFFBYLATEST: { | ||
REQUEST: "VIEW_BY_STUFF_LATEST", | ||
SUCCESS: "BY_STUFF_LATEST_READ_SUCCESS", | ||
FAILED: "BY_STUFF_LATEST_READ_FAILED" | ||
}, | ||
STUFFBYVIEW: { | ||
REQUEST: "VIEW_BY_STUFF_VIEW", | ||
SUCCESS: "BY_STUFF_VIEWREAD_SUCCESS", | ||
FAILED: "BY_STUFF_VIEW_READ_FAILED" | ||
} | ||
}; | ||
|
||
export function recipeAllRequest() { | ||
return { | ||
type: actions.ALL.REQUEST | ||
}; | ||
} | ||
|
||
export function recipeAllSuccess(result) { | ||
return { | ||
type: actions.ALL.SUCCESS, | ||
payload: { | ||
result | ||
} | ||
}; | ||
} | ||
|
||
export function recipeIDRequest(id) { | ||
return { | ||
type: actions.BYID.REQUEST, | ||
payload: { | ||
id | ||
} | ||
}; | ||
} | ||
|
||
export function recipeIDSuccess(result) { | ||
return { | ||
type: actions.BYID.SUCCESS, | ||
payload: { | ||
result | ||
} | ||
}; | ||
} | ||
|
||
export function recipeTagLatestRequest(tag) { | ||
return { | ||
type: actions.TAGBYLATEST.REQUEST, | ||
payload: { | ||
tag | ||
} | ||
}; | ||
} | ||
|
||
export function recipeTagLatestSuccess(result) { | ||
return { | ||
type: actions.TAGBYLATEST.SUCCESS, | ||
payload: { | ||
result | ||
} | ||
}; | ||
} | ||
|
||
export function recipeTagViewRequest(tag) { | ||
return { | ||
type: actions.TAGBYVIEW.REQUEST, | ||
payload: { | ||
tag | ||
} | ||
}; | ||
} | ||
|
||
export function recipeTagViewSuccess(result) { | ||
return { | ||
type: actions.TAGBYVIEW.SUCCESS, | ||
payload: { | ||
result | ||
} | ||
}; | ||
} | ||
|
||
export function recipeStuffLatestRequest(ingredient) { | ||
return { | ||
type: actions.STUFFBYLATEST.REQUEST, | ||
payload: { | ||
ingredient | ||
} | ||
}; | ||
} | ||
|
||
export function recipeStuffLatestSuccess(result) { | ||
return { | ||
type: actions.STUFFBYLATEST.SUCCESS, | ||
payload: { | ||
result | ||
} | ||
}; | ||
} | ||
|
||
export function recipeStuffViewRequest(ingredient) { | ||
return { | ||
type: actions.STUFFBYVIEW.REQUEST, | ||
payload: { | ||
ingredient | ||
} | ||
}; | ||
} | ||
|
||
export function recipeStuffViewSuccess(result) { | ||
return { | ||
type: actions.STUFFBYVIEW.SUCCESS, | ||
payload: { | ||
result | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import * as webRequestUtil from "./rootAPI"; | ||
|
||
export async function enrolmentRecipe({ data }) { | ||
const url = "recipe"; | ||
|
||
console.log(data); | ||
const body = { | ||
data | ||
}; | ||
const res = await webRequestUtil.post({ url, body }); | ||
return res.data; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import * as webRequestUtil from "./rootAPI"; | ||
|
||
export async function getRecipe() { | ||
const url = "recipe"; | ||
const res = await webRequestUtil.get({ url }); | ||
return res.data; | ||
} | ||
|
||
export async function getRecipeByID({id}) { | ||
const url = "recipe/details"; | ||
const body = { | ||
id | ||
}; | ||
|
||
const res = await webRequestUtil.get({ url, body }); | ||
return res.data; | ||
} | ||
|
||
export async function getTagByLatest({tag}) { | ||
const url = "recipe/tag/new"; | ||
const body = { | ||
tag | ||
}; | ||
const res = await webRequestUtil.get({ url, body }); | ||
return res.data; | ||
} | ||
|
||
export async function getTagByView({tag}) { | ||
const url = "recipe/tag/view"; | ||
const body = { | ||
tag | ||
}; | ||
const res = await webRequestUtil.get({ url, body }); | ||
return res.data; | ||
} | ||
|
||
export async function getStuffByLatest({ingredient}) { | ||
const url = "recipe/ingredient/new"; | ||
const body = { | ||
ingredient | ||
}; | ||
const res = await webRequestUtil.get({ url, body }); | ||
return res.data; | ||
} | ||
|
||
export async function getStuffByView({ingredient}) { | ||
const url = "recipe/ingredient/view"; | ||
const body = { | ||
ingredient | ||
}; | ||
const res = await webRequestUtil.get({ url, body }); | ||
return res.data; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.