Fixed database not casting string properly
This commit is contained in:
parent
44869a00e6
commit
8cca937371
3 changed files with 4 additions and 2 deletions
|
@ -436,6 +436,8 @@ $utopia->post('/v1/database/:collectionId/documents')
|
||||||
throw new Exception('$uid is not allowed for creating new documents, try update instead', 400);
|
throw new Exception('$uid is not allowed for creating new documents, try update instead', 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data = (is_string($data) && $result = json_decode($data, true)) ? $result : $data; // Cast to JSON array
|
||||||
|
|
||||||
$collection = $projectDB->getDocument($collectionId/*, $isDev*/);
|
$collection = $projectDB->getDocument($collectionId/*, $isDev*/);
|
||||||
|
|
||||||
if (is_null($collection->getUid()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) {
|
if (is_null($collection->getUid()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) {
|
||||||
|
|
|
@ -12,4 +12,4 @@ $client
|
||||||
|
|
||||||
$projects = new Projects($client);
|
$projects = new Projects($client);
|
||||||
|
|
||||||
$result = $projects->createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 0);
|
$result = $projects->createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 1);
|
|
@ -12,4 +12,4 @@ $client
|
||||||
|
|
||||||
$projects = new Projects($client);
|
$projects = new Projects($client);
|
||||||
|
|
||||||
$result = $projects->updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 0, 'GET', 'https://example.com');
|
$result = $projects->updateTask('[PROJECT_ID]', '[TASK_ID]', '[NAME]', 'play', '', 1, 'GET', 'https://example.com');
|
Loading…
Reference in a new issue