[TIL] 07.09

2020. 7. 9. 21:48TIL

api가 그냥 데이터를 전체다 뿌려주어서 프론트에서 데이터를 정리해서 사용하는 부분이 있었다. 

지금 당장 수정 할 순 없고 추후 수정 될 곳이였는데 미리 어떻게 api 데이터를 받아서 사용할지 생각해 보았다. 

필요한 데이터들을 정리하고 현재 받아오는 데이터들의 관계를 보며 데이터를 정리해 보았다.

 

GET nutrients/{id}

Response

{
	nutrient: { 
		"id": number,  
		"name": "string", 
		"code": "string",  
		"description": "string" 
	},
	answers: [
		{
			"answer": "string", 
			"part": "string" 
		},
		...
	],
	dailyDosageReference: {
		"max": number, 
		"min": number, 
		"recommendationMax": number, 
		"recommendationMin": number, 
		"unit": "string" 
	},
	synerge: [ 
		{
			"id": number, 
			"name": "string", 
			"code": "string" 
		},
		...
	]
}

'TIL' 카테고리의 다른 글

[TIL] 07.20  (0) 2020.07.20
[TIL] 07.13  (0) 2020.07.13
[TIL] 07.08  (0) 2020.07.08
[TIL] 07.06 react life-cycle  (0) 2020.07.06
[TIL] 06.24  (0) 2020.06.24