Skip to content

Commit db246ff

Browse files
Fix CLI encoding of JSON objects
1 parent d7365ec commit db246ff

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

app/account.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
$path = str_replace([], [], '/account/prefs');
171171
$params = [];
172172
/** Body Params */
173-
$params['prefs'] = $prefs;
173+
$params['prefs'] = \json_decode($prefs);
174174
$response = $client->call(Client::METHOD_PATCH, $path, [
175175
'content-type' => 'application/json',
176176
], $params);

app/database.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218
$path = str_replace(['{collectionId}'], [$collectionId], '/database/collections/{collectionId}/documents');
219219
$params = [];
220220
/** Body Params */
221-
$params['data'] = $data;
221+
$params['data'] = \json_decode($data);
222222
$params['read'] = !is_array($read) ? array($read) : $read;
223223
$params['write'] = !is_array($write) ? array($write) : $write;
224224
$params['parentDocument'] = $parentDocument;
@@ -267,7 +267,7 @@
267267
$path = str_replace(['{collectionId}', '{documentId}'], [$collectionId, $documentId], '/database/collections/{collectionId}/documents/{documentId}');
268268
$params = [];
269269
/** Body Params */
270-
$params['data'] = $data;
270+
$params['data'] = \json_decode($data);
271271
$params['read'] = !is_array($read) ? array($read) : $read;
272272
$params['write'] = !is_array($write) ? array($write) : $write;
273273
$response = $client->call(Client::METHOD_PATCH, $path, [

app/functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
$params['name'] = $name;
9696
$params['execute'] = !is_array($execute) ? array($execute) : $execute;
9797
$params['runtime'] = $runtime;
98-
$params['vars'] = $vars;
98+
$params['vars'] = \json_decode($vars);
9999
$params['events'] = !is_array($events) ? array($events) : $events;
100100
$params['schedule'] = $schedule;
101101
$params['timeout'] = (int)$timeout;
@@ -146,7 +146,7 @@
146146
/** Body Params */
147147
$params['name'] = $name;
148148
$params['execute'] = !is_array($execute) ? array($execute) : $execute;
149-
$params['vars'] = $vars;
149+
$params['vars'] = \json_decode($vars);
150150
$params['events'] = !is_array($events) ? array($events) : $events;
151151
$params['schedule'] = $schedule;
152152
$params['timeout'] = (int)$timeout;

app/users.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
$path = str_replace(['{userId}'], [$userId], '/users/{userId}/prefs');
231231
$params = [];
232232
/** Body Params */
233-
$params['prefs'] = $prefs;
233+
$params['prefs'] = \json_decode($prefs);
234234
$response = $client->call(Client::METHOD_PATCH, $path, [
235235
'content-type' => 'application/json',
236236
], $params);

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ APPWRITE_EXECUTABLE_NAME=appwrite
2424
APPWRITE_EXECUTABLE_FILEPATH="$APPWRITE_INSTALL_DIR/$APPWRITE_EXECUTABLE_NAME"
2525

2626
# Appwrite CLI temp name
27-
APPWRITE_TEMP_NAME=temp
27+
APPWRITE_TEMP_NAME=temp-$(date +%s)
2828

2929
# Appwrite CLI image name
3030
APPWRITE_CLI_IMAGE_NAME=appwrite/cli

0 commit comments

Comments
 (0)