mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
Check for documentId on ops that require it
This commit is contained in:
parent
46f8d76d7a
commit
2b3795224d
1 changed files with 9 additions and 0 deletions
|
|
@ -71,6 +71,15 @@ class Operation extends Validator
|
|||
return false;
|
||||
}
|
||||
|
||||
// If action requires documentId, it must be present
|
||||
if (
|
||||
isset($this->requiresDocumentId[$value['action']]) &&
|
||||
!\array_key_exists('documentId', $value)
|
||||
) {
|
||||
$this->description = "Key 'documentId' is required for action '{$value['action']}'";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Data must be array (can be empty)
|
||||
if (!\is_array($value['data'])) {
|
||||
$this->description = "Key 'data' must be an array";
|
||||
|
|
|
|||
Loading…
Reference in a new issue