Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
loks0n committed Oct 7, 2024
1 parent bf4ba7c commit 00118b4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions mock-server/app/http.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@
->label('scope', 'public')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->inject('response')
->param('projectId', '', new Text(256), 'Project ID')
->action(function () {
->inject('request')
->action(function (Request $request) {
$projectId = $request->getHeader('x-appwrite-project', '');

if (empty($projectId)) {
throw new Exception(Exception::GENERAL_MOCK, 'Missing project ID');
}
Expand Down
2 changes: 1 addition & 1 deletion templates/node/src/client.ts.twig
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class Client {
}

async ping(): Promise<string> {
return this.call('GET', new URL('/ping', this.config.endpoint), {}, {}, 'json');
return this.call('GET', new URL(this.config.endpoint + '/ping'));
}

async redirect(method: string, url: URL, headers: Headers = {}, params: Payload = {}): Promise<string> {
Expand Down
2 changes: 1 addition & 1 deletion templates/web/src/client.ts.twig
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ class Client {
}

async ping(): Promise<string> {
return this.call('GET', new URL('/ping', this.config.endpoint), {}, {}, 'json');
return this.call('GET', new URL(this.config.endpoint + '/ping'));
}

async call(method: string, url: URL, headers: Headers = {}, params: Payload = {}, responseType = 'json'): Promise<any> {
Expand Down

0 comments on commit 00118b4

Please sign in to comment.