Skip to Content
풀스택 서버리스: 리액트, AWS, 그래프QL을 이용한 최신 애플리케이션 개발
book

풀스택 서버리스: 리액트, AWS, 그래프QL을 이용한 최신 애플리케이션 개발

by 김범준, 네이더 다빗
July 2021
Beginner to intermediate
216 pages
4h 26m
Korean
Hanbit Media, Inc.
Content preview from 풀스택 서버리스: 리액트, AWS, 그래프QL을 이용한 최신 애플리케이션 개발
150
풀스택 서버리스
호작용합니다.
API
클래스를 사용하면
API
이름과 경로(
/
products
)를 사용하여
get
,
put
,
post
delete
같은 요청을 할 수 있습니다.
Admin
컴포넌트에서는 전송하려는 데이터를
body
에 포함해서 객체로 생성하고
API
.
post
출을 통해 전달합니다.
// 요청과 함께 전달할 객체 생성
const data = {
body: { ...itemInfo, price: parseInt(itemInfo.price) }
}
// 초기 상태로 로컬 상태를 수정하여 양식을 초기화
updateItemInfo(initialState)
// API.post 호출
await API.post('ecommerceapi', '/products', data)
7.6.7
Main
컴포넌트
마지막 컴포넌트는 항목을 렌더링하는
Main
컴포넌트입니다.
이 컴포넌트에는 두 가지 주요 함수로
getProducts
deleteItem
가 있습니다.
getProducts
1
.
API
.
get
을 호출합니다. 데이터가 반환되면
API
에서 반환된 데이터로
state
products
배열을 업
데이트합니다.
deleteItem
1
.
삭제할 항목의
id
를 이용해서 삭제할 항목을 제외한
products
배열을 생성합니다.
2
.
생성된
products
배열은 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

실전 시계열 분석: 통계와 머신러닝을 활용한 예측 기법

실전 시계열 분석: 통계와 머신러닝을 활용한 예측 기법

박찬성, 에일린 닐슨

Publisher Resources

ISBN: 9791162244487