Merge pull request #5671 from appwrite/feat-update-error-message
Update document missing params error message
This commit is contained in:
commit
fd7a2cbfad
3 changed files with 8 additions and 2 deletions
|
@ -403,9 +403,14 @@ return [
|
|||
'description' => 'The document structure is invalid. Please ensure the attributes match the collection definition.',
|
||||
'code' => 400,
|
||||
],
|
||||
Exception::DOCUMENT_MISSING_DATA => [
|
||||
'name' => Exception::DOCUMENT_MISSING_DATA,
|
||||
'description' => 'The document data is missing. You must provide the document data.',
|
||||
'code' => 400,
|
||||
],
|
||||
Exception::DOCUMENT_MISSING_PAYLOAD => [
|
||||
'name' => Exception::DOCUMENT_MISSING_PAYLOAD,
|
||||
'description' => 'The document payload is missing.',
|
||||
'description' => 'The document data and permissions are missing. You must provide either the document data or permissions to be updated.',
|
||||
'code' => 400,
|
||||
],
|
||||
Exception::DOCUMENT_ALREADY_EXISTS => [
|
||||
|
|
|
@ -2653,7 +2653,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents')
|
|||
$data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array
|
||||
|
||||
if (empty($data)) {
|
||||
throw new Exception(Exception::DOCUMENT_MISSING_PAYLOAD);
|
||||
throw new Exception(Exception::DOCUMENT_MISSING_DATA);
|
||||
}
|
||||
|
||||
if (isset($data['$id'])) {
|
||||
|
|
|
@ -134,6 +134,7 @@ class Exception extends \Exception
|
|||
/** Documents */
|
||||
public const DOCUMENT_NOT_FOUND = 'document_not_found';
|
||||
public const DOCUMENT_INVALID_STRUCTURE = 'document_invalid_structure';
|
||||
public const DOCUMENT_MISSING_DATA = 'document_missing_data';
|
||||
public const DOCUMENT_MISSING_PAYLOAD = 'document_missing_payload';
|
||||
public const DOCUMENT_ALREADY_EXISTS = 'document_already_exists';
|
||||
public const DOCUMENT_UPDATE_CONFLICT = 'document_update_conflict';
|
||||
|
|
Loading…
Reference in a new issue