Skip to content

Commit 772c2dd

Browse files
authored
Merge pull request #99 from christyjacob4/feat-na-appwrite-cli
feat: add support for file previews
2 parents 8f2ee1f + 0cc9bd4 commit 772c2dd

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

templates/cli/app/services/service.php.twig

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ $cli
9494
$params['{{ parameter.name }}'] = ${{ parameter.name | caseCamel }};
9595
{% endfor %}
9696
97+
{% if method.type == 'location' %}
98+
99+
$params['project'] = $client->getPreference('X-Appwrite-Project');
100+
$params['key'] = $client->getPreference('X-Appwrite-Key');
101+
$path = $client->getPreference(Client::PREFERENCE_ENDPOINT).$path . "?" . http_build_query($params);
102+
echo $path;
103+
104+
{% else %}
105+
97106
$response = $client->call(Client::METHOD_{{ method.method | caseUpper }}, $path, [
98107
{% for parameter in method.parameters.header %}
99108
'{{ parameter.name }}' => ${{ parameter.name | caseCamel }},
@@ -103,12 +112,14 @@ $cli
103112
{% endfor %}
104113
], $params);
105114
115+
$parser->parseResponse($response);
116+
117+
{% endif %}
118+
106119
{% if method.packaging %}
107120
unlink($archive_file_path); // as we already obtained a tar.gz
108121
unlink($archive_file_path.'.gz');
109122
{% endif %}
110-
111-
$parser->parseResponse($response);
112123
});
113124
114125
{% endfor %}

0 commit comments

Comments
 (0)