how to get response data where $obj->create()?
Opened this issue · 0 comments
lyongdee commented
how to get response data when $obj->create()?
ScriptTagService.php
public function update(ScriptTag $scriptTag)
{
$data = $scriptTag->exportData();
$response = $this->request(
'/admin/script_tags/'.$scriptTag->id.'.json', 'PUT', array(
'script_tag' => $data
)
);
$scriptTag->setData($response['script_tag']);
}
Fix:
public function create(ScriptTag &$scriptTag)
{
$data = $scriptTag->exportData();
$response = $this->request(
'/admin/script_tags.json', 'POST', array(
'script_tag' => $data
)
);
//$scriptTag->setData($response['script_tag']);
return $response['script_tag'];
}