extends HTTPRequest


# Обработчик ответа на HTTP запрос к бэкэнду
func _on_HTTPRequestFind_request_completed(result, response_code, headers, body):
	var resp = body.get_string_from_utf8()
	var parsed_resp = parse_json(resp)
	var simpled_data = parsed_resp['data']['universoObjekto']['edges']
	
	$'../'.ItemListContent.clear()
	$'../canvas/MarginContainer/VBoxContainer/'.get_node("ItemList").clear()
	# $'../MarginContainer/VBoxContainer/'.get_node("DetailLabel").set_text("")
	
	for item in simpled_data:
		var itemj ={
			'nomo':item['node']['nomo']['enhavo'],
			'priskribo':item['node']['priskribo']['enhavo'],
			'uuid':item['node']['uuid'],
			'koordinatoX':item['node']['koordinatoX'],
			'koordinatoY':item['node']['koordinatoY'],
			'koordinatoZ':item['node']['koordinatoZ'],
			'posedantoObjekto':item['node']['posedantoObjekto'],
			'inCosmo':item['node']['inCosmo'],
		}
		$'../'.ItemListContent.append(itemj)
#	print('=====',$'../'.ItemListContent)
	$'../'.FillItemList()
