field manager: reset to detault

This commit is contained in:
yuri
2016-08-26 12:19:47 +03:00
parent 5feb0eb7c7
commit 0b6a29a035
4 changed files with 103 additions and 29 deletions

View File

@@ -107,5 +107,18 @@ class FieldManager extends \Espo\Core\Controllers\Base
return $res;
}
public function postActionResetToDefault($params, $data)
{
if (empty($data['scope']) || empty($data['name'])) {
throw new BadRequest();
}
$this->getContainer()->get('fieldManager')->resetToDefault($data['name'], $data['scope']);
$this->getContainer()->get('dataManager')->rebuildMetadata();
return true;
}
}