1
0
Fork 0
mirror of synced 2024-06-28 19:20:25 +12:00

Fixed database not casting string properly

This commit is contained in:
eldadfux 2019-10-03 23:57:57 +03:00
parent 44869a00e6
commit 8cca937371
3 changed files with 4 additions and 2 deletions

View file

@ -435,6 +435,8 @@ $utopia->post('/v1/database/:collectionId/documents')
if (isset($data['$uid'])) {
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*/);

View file

@ -12,4 +12,4 @@ $client
$projects = new Projects($client);
$result = $projects->createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 0);
$result = $projects->createWebhook('[PROJECT_ID]', '[NAME]', [], '[URL]', 1);

View file

@ -12,4 +12,4 @@ $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');