Skip to content

Commit f8fbc4b

Browse files
authored
Merge pull request #1181 from appwrite/fix-readonly
fix: remove delete param logic from methods
2 parents 7f19171 + 8e7d544 commit f8fbc4b

File tree

3 files changed

+0
-21
lines changed

3 files changed

+0
-21
lines changed

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,6 @@ export class {{ service.name | caseUcfirst }} {
109109
}
110110
{%~ endif %}
111111
{%~ endfor %}
112-
{%~ for parameter in method.parameters.all %}
113-
{%~ if parameter.type == 'object' %}
114-
{%~ for attribute in parameter | getReadOnlyProperties(method.responseModel, spec) %}
115-
delete {{ parameter.name | caseCamel | escapeKeyword }}?.{{ attribute }};
116-
{%~ endfor %}
117-
{%~ endif %}
118-
{%~ endfor %}
119112

120113
const apiPath = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel | escapeKeyword }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %};
121114
const payload: Payload = {};

templates/react-native/src/services/template.ts.twig

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,6 @@ export class {{ service.name | caseUcfirst }} extends Service {
113113
throw new {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | caseCamel | escapeKeyword }}"');
114114
}
115115

116-
{% endif %}
117-
{% endfor %}
118-
{% for parameter in method.parameters.all %}
119-
{% if parameter.type == 'object' %}
120-
{% for attribute in parameter | getReadOnlyProperties(method.responseModel, spec) %}
121-
delete {{ parameter.name | caseCamel | escapeKeyword }}?.{{ attribute }};
122-
{% endfor %}
123116
{% endif %}
124117
{% endfor %}
125118
const apiPath = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel | escapeKeyword }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %};

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,6 @@ export class {{ service.name | caseUcfirst }} {
110110
}
111111
{%~ endif %}
112112
{%~ endfor %}
113-
{%~ for parameter in method.parameters.all %}
114-
{%~ if parameter.type == 'object' %}
115-
{%~ for attribute in parameter | getReadOnlyProperties(method.responseModel, spec) %}
116-
delete {{ parameter.name | caseCamel | escapeKeyword }}?.{{ attribute }};
117-
{%~ endfor %}
118-
{%~ endif %}
119-
{%~ endfor %}
120113

121114
const apiPath = '{{ method.path }}'{% for parameter in method.parameters.path %}.replace('{{ '{' }}{{ parameter.name | caseCamel | escapeKeyword }}{{ '}' }}', {{ parameter.name | caseCamel | escapeKeyword }}){% endfor %};
122115
const payload: Payload = {};

0 commit comments

Comments
 (0)