Skip to content

Commit c1f633e

Browse files
committed
Syntax fixes
1 parent 6921670 commit c1f633e

File tree

11 files changed

+25
-31
lines changed

11 files changed

+25
-31
lines changed

templates/android/library/src/main/java/io/appwrite/Query.kt.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Query {
3030

3131
fun endsWith(attribute: String, value: String) = Query.addQuery(attribute, "endsWith", value)
3232

33-
fun select(attributes: List<String>) = "select([${attributes.map { \"it\" }.joinToString(",")}])"
33+
fun select(attributes: List<String>) = "select([${attributes.joinToString(",") { "\"it\"" }}])"
3434

3535
fun orderAsc(attribute: String) = "orderAsc(\"${attribute}\")"
3636

templates/dart/lib/query.dart.twig

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,7 @@ class Query {
2828

2929
static isNotNull(String attribute) => 'isNotNull("$attribute")';
3030

31-
static between(String attribute, int start, int end) =>
32-
_addQuery(attribute, 'between', [start, end]);
33-
34-
static between(String attribute, double start, double end) =>
35-
_addQuery(attribute, 'between', [start, end]);
36-
37-
static between(String attribute, String start, String end) =>
31+
static between(String attribute, dynamic start, dynamic end) =>
3832
_addQuery(attribute, 'between', [start, end]);
3933

4034
static startsWith(String attribute, String value) =>

templates/deno/src/query.ts.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export class Query {
3030
static isNotNull = (attribute: string): string =>
3131
`isNotNull("${attribute}")`;
3232

33-
static between = (attribute: string, value: QueryTypesList): string =>
34-
Query.addQuery(attribute, "between", value);
33+
static between = (attribute: string, start: string|number, end: string|number): string =>
34+
Query.addQuery(attribute, "between", [start, end]);
3535

3636
static startsWith = (attribute: string, value: string): string =>
3737
Query.addQuery(attribute, "startsWith", value);

templates/kotlin/src/main/kotlin/io/appwrite/Query.kt.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Query {
3030

3131
fun endsWith(attribute: String, value: String) = Query.addQuery(attribute, "endsWith", value)
3232

33-
fun select(attributes: List<String>) = "select([${attributes.map { \"it\" }.joinToString(",")}])"
33+
fun select(attributes: List<String>) = "select([${attributes.joinToString(",") { "\"it\"" }}])"
3434

3535
fun orderAsc(attribute: String) = "orderAsc(\"${attribute}\")"
3636

templates/node/lib/query.js.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class Query {
2323
static isNotNull = (attribute) =>
2424
`isNotNull("${attribute}")`;
2525

26-
static between = (attribute, value) =>
27-
Query.addQuery(attribute, "between", value);
26+
static between = (attribute, start, end) =>
27+
Query.addQuery(attribute, "between", [start, end]);
2828

2929
static startsWith = (attribute, value) =>
3030
Query.addQuery(attribute, "startsWith", value);

templates/php/src/Query.php.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class Query
118118
* @param string|int|float $end
119119
* @return string
120120
*/
121-
public static function between(string $attribute, string|int|float $start, string|int|float $end): string
121+
public static function between(string $attribute, mixed $start, mixed $end): string
122122
{
123123
return self::addQuery($attribute, 'between', [$start, $end]);
124124
}

templates/python/package/query.py.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ class Query:
3636
return Query.add_query(attribute, "between", [start, end])
3737

3838
@staticmethod
39-
def starts_with(value):
39+
def starts_with(attribute, value):
4040
return Query.add_query(attribute, "startsWith", value)
4141

4242
@staticmethod
43-
def ends_with(value):
43+
def ends_with(attribute, value):
4444
return Query.add_query(attribute, "endsWith", value)
4545

4646
@staticmethod

templates/ruby/lib/container/query.rb.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ module {{spec.title | caseUcfirst}}
3333
return "isNotNull(\"#{attribute}\")"
3434
end
3535

36-
def between(attribute, start, end)
37-
return add_query(attribute, "between", [start, end])
36+
def between(attribute, start, ending)
37+
return add_query(attribute, "between", [start, ending])
3838
end
3939

4040
def starts_with(attribute, value)

templates/web/src/query.ts.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export class Query {
2727
static isNotNull = (attribute: string): string =>
2828
`isNotNull("${attribute}")`;
2929

30-
static between = (attribute: string, value: QueryTypesList): string =>
31-
Query.addQuery(attribute, "between", value);
30+
static between = (attribute: string, start: string|number, end: string|number): string =>
31+
Query.addQuery(attribute, "between", [start, end]);
3232

3333
static startsWith = (attribute: string, value: string): string =>
3434
Query.addQuery(attribute, "startsWith", value);

tests/Base.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ abstract class Base extends TestCase
6969
'search("name", ["john"])',
7070
'isNull("name")',
7171
'isNotNull("name")',
72-
'between("age", 50, 100)',
73-
'between("age", 50.5, 100.5)',
74-
'between("name", "Anna", "Brad")',
72+
'between("age", [50,100])',
73+
'between("age", [50.5,100.5])',
74+
'between("name", ["Anna","Brad"])',
7575
'startsWith("name", "Ann")',
7676
'endsWith("name", "nne")',
7777
'select("name", "age")',

0 commit comments

Comments
 (0)