This commit is contained in:
Yuri Kuznetsov
2021-04-03 12:16:42 +03:00
3 changed files with 22 additions and 8 deletions
@@ -61,9 +61,6 @@
"fieldLevel": {
},
"scopeFieldLevel": {
"Attachment": {
"parent": false
},
"EmailFolder": {
"assignedUser": {
"read": "yes",
@@ -78,9 +78,6 @@
"Meeting": {
"reminders": false
},
"Attachment": {
"parent": false
},
"Note": {
"isInternal": false,
"isGlobal": false
+22 -2
View File
@@ -88,12 +88,32 @@ class Attachment extends Record
}
}
public function filterUpdateInput(StdClass $data): void
{
parent::filterUpdateInput($data);
unset($data->parentId);
unset($data->parentType);
unset($data->relatedId);
unset($data->relatedType);
}
public function filterCreateInput(StdClass $data) : void
{
parent::filterCreateInput($data);
if (empty($data->file)) {
return;
unset($data->parentId);
unset($data->relatedId);
unset($data->relatedType);
if (!property_exists($data, 'file')) {
throw new BadRequest("No file contents.");
}
if (!is_string($data->file)) {
throw new BadRequest("Non-string file contents.");
}
$arr = explode(',', $data->file);