Skip to content

Commit 30f5595

Browse files
committed
fix: enum casing
1 parent 867b377 commit 30f5595

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

templates/cli/lib/type-generation/languages/php.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use Appwrite\\Models\\<%- toPascalCase(attribute.relatedCollection) %>;
5555
<% if (attribute.format === 'enum') { -%>
5656
enum <%- toPascalCase(attribute.key) %> {
5757
<% for (const [index, element] of Object.entries(attribute.elements)) { -%>
58-
case <%- element.toUpperCase() %> = '<%- element %>';
58+
case <%- toUpperSnakeCase(element) %> = '<%- element %>';
5959
<% } -%>
6060
}
6161

templates/cli/lib/type-generation/languages/swift.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Swift extends LanguageMeta {
4848
<% if (attribute.format === 'enum') { -%>
4949
public enum <%- toPascalCase(attribute.key) %>: String, Codable, CaseIterable {
5050
<% for (const [index, element] of Object.entries(attribute.elements)) { -%>
51-
case <%- element %> = "<%- element %>"
51+
case <%- toSnakeCase(element) %> = "<%- element %>"
5252
<% } -%>
5353
}
5454

templates/cli/lib/type-generation/languages/typescript.js.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ class TypeScript extends LanguageMeta {
7272
<% if (attribute.format === 'enum') { -%>
7373
export enum <%- toPascalCase(attribute.key) %> {
7474
<% for (const [index, element] of Object.entries(attribute.elements)) { -%>
75-
<%- element.toUpperCase() %> = "<%- element %>",
75+
<%- toUpperSnakeCase(element) %> = "<%- element %>",
7676
<% } -%>
7777
}
7878

7979
<% } -%>
8080
<% } -%>
8181
<% } -%>
82-
<% for (const collection of collections) { %>
82+
<% for (const collection of collections) { -%>
8383
export type <%- toPascalCase(collection.name) %> = Models.Document & {
8484
<% for (const attribute of collection.attributes) { -%>
8585
<%- toCamelCase(attribute.key) %>: <%- getType(attribute) %>;

0 commit comments

Comments
 (0)