Skip to content

Commit e790b38

Browse files
committed
chore: remove unnecessary promise
1 parent 6d5b35f commit e790b38

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/SDK/Language/Web.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public function getGenerics(string $model, array $spec, bool $skipFirst = false)
269269
public function getReturn(array $method, array $spec): string
270270
{
271271
if ($method['type'] === 'webAuth') {
272-
return 'Promise<void | string>';
272+
return 'void | string';
273273
}
274274

275275
if ($method['type'] === 'location') {

templates/web/src/services/template.ts.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ export class {{ service.name | caseUcfirst }} {
7777
{%~ if method.type == 'webAuth' %}
7878
if (typeof window !== 'undefined' && window?.location) {
7979
window.location.href = uri.toString();
80-
return Promise.resolve();
80+
return;
8181
} else {
82-
return Promise.resolve(uri.toString());
82+
return uri.toString();
8383
}
8484
{%~ elseif method.type == 'location' %}
8585
return uri.toString();

0 commit comments

Comments
 (0)