mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
changed the error message for client side
This commit is contained in:
+2
-2
@@ -354,11 +354,11 @@ class Create extends Action
|
||||
// Allowing to add createdAt and updatedAt timestamps if server side(api key
|
||||
if (!$isAPIKey && !$isPrivilegedUser) {
|
||||
if (isset($document['$createdAt'])) {
|
||||
throw new Exception($this->getInvalidStructureException(), 'Attribute "$createdAt" is not allowed');
|
||||
throw new Exception($this->getInvalidStructureException(), 'Attribute "$createdAt" can not be modified. Please use a server SDK with an API key to modify server attributes.');
|
||||
}
|
||||
|
||||
if (isset($document['$updatedAt'])) {
|
||||
throw new Exception($this->getInvalidStructureException(), 'Attribute "$updatedAt" is not allowed');
|
||||
throw new Exception($this->getInvalidStructureException(), 'Attribute "$updatedAt" can not be modified. Please use a server SDK with an API key to modify server attributes.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -112,11 +112,11 @@ class Update extends Action
|
||||
// Allowing to add createdAt and updatedAt timestamps if server side(api key)
|
||||
if (!$isAPIKey && !$isPrivilegedUser) {
|
||||
if (isset($data['$createdAt'])) {
|
||||
throw new Exception($this->getInvalidStructureException(), 'Attribute "$createdAt" is not allowed');
|
||||
throw new Exception($this->getInvalidStructureException(), 'Attribute "$createdAt" can not be modified. Please use a server SDK with an API key to modify server attributes.');
|
||||
}
|
||||
|
||||
if (isset($data['$updatedAt'])) {
|
||||
throw new Exception($this->getInvalidStructureException(), 'Attribute "$updatedAt" is not allowed');
|
||||
throw new Exception($this->getInvalidStructureException(), 'Attribute "$updatedAt" can not be modified. Please use a server SDK with an API key to modify server attributes.');
|
||||
}
|
||||
}
|
||||
// Read permission should not be required for update
|
||||
|
||||
+2
-2
@@ -156,11 +156,11 @@ class Upsert extends Action
|
||||
// Allowing to add createdAt and updatedAt timestamps if server side(api key)
|
||||
if (!$isAPIKey && !$isPrivilegedUser) {
|
||||
if (isset($data['$createdAt'])) {
|
||||
throw new Exception($this->getInvalidStructureException(), 'Attribute "$createdAt" is not allowed');
|
||||
throw new Exception($this->getInvalidStructureException(), 'Attribute "$createdAt" can not be modified. Please use a server SDK with an API key to modify server attributes.');
|
||||
}
|
||||
|
||||
if (isset($data['$updatedAt'])) {
|
||||
throw new Exception($this->getInvalidStructureException(), 'Attribute "$updatedAt" is not allowed');
|
||||
throw new Exception($this->getInvalidStructureException(), 'Attribute "$updatedAt" can not be modified. Please use a server SDK with an API key to modify server attributes.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user