Skip to content

Commit 6846d4c

Browse files
committed
feat: review comments
1 parent ae72bb7 commit 6846d4c

File tree

5 files changed

+31
-19
lines changed

5 files changed

+31
-19
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ class Query {
2020

2121
fun orderDesc(attribute: String) = "orderDesc(\"${attribute}\")"
2222

23-
fun cursorBefore(attribute: String) = "cursorBefore(\"${attribute}\")"
23+
fun cursorBefore(documentId: String) = "cursorBefore(\"${documentId}\")"
2424

25-
fun cursorAfter(attribute: String) = "cursorAfter(\"${attribute}\")"
25+
fun cursorAfter(documentId: String) = "cursorAfter(\"${documentId}\")"
2626

2727
fun limit(limit: Int) = "limit(${limit})"
2828

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ class Query {
2020

2121
fun orderDesc(attribute: String) = "orderDesc(\"${attribute}\")"
2222

23-
fun cursorBefore(attribute: String) = "cursorBefore(\"${attribute}\")"
23+
fun cursorBefore(documentId: String) = "cursorBefore(\"${documentId}\")"
2424

25-
fun cursorAfter(attribute: String) = "cursorAfter(\"${attribute}\")"
25+
fun cursorAfter(documentId: String) = "cursorAfter(\"${documentId}\")"
2626

2727
fun limit(limit: Int) = "limit(${limit})"
2828

templates/node/index.d.ts.twig

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,19 @@ declare module "{{ language.params.npmPackage|caseDash }}" {
157157

158158
static search(attribute: string, value: string): string;
159159

160-
private static addQuery(attribute: string, oper: string, value: QueryTypes): string;
160+
static orderDesc(attribute: string): string;
161+
162+
static orderAsc(attribute: string): string;
163+
164+
static cursorAfter(documentId: string): string;
165+
166+
static cursorBefore(documentId: string): string;
167+
168+
static limit(value: number): string;
169+
170+
static offset = (value: number): string;
171+
172+
private static addQuery(attribute: string, method: string, value: QueryTypes): string;
161173

162174
private static parseValues(value: QueryTypes): string;
163175
}

templates/php/src/Query.php.twig

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,41 +91,41 @@ class Query
9191
/**
9292
* Cursor After
9393
*
94-
* @param String $attribute
94+
* @param String $documentId
9595
* @return string
9696
*/
97-
public static function cursorAfter(String $attribute): string {
98-
return 'cursorAfter("' . $attribute . '")';
97+
public static function cursorAfter(String $documentId): string {
98+
return 'cursorAfter("' . $documentId . '")';
9999
}
100100
101101
/**
102102
* Cursor Before
103103
*
104-
* @param String $attribute
104+
* @param String $documentId
105105
* @return string
106106
*/
107-
public static function cursorBefore(String $attribute): string {
108-
return 'cursorBefore("' . $attribute . '")';
107+
public static function cursorBefore(String $documentId): string {
108+
return 'cursorBefore("' . $documentId . '")';
109109
}
110110
111111
/**
112112
* Order Asc
113113
*
114-
* @param String $id
114+
* @param String $attribute
115115
* @return string
116116
*/
117-
public static function orderAsc(String $id): string {
118-
return 'orderAsc("' . $id . '")';
117+
public static function orderAsc(String $attribute): string {
118+
return 'orderAsc("' . $attribute . '")';
119119
}
120120
121121
/**
122122
* Order Desc
123123
*
124-
* @param String $id
124+
* @param String $attribute
125125
* @return string
126126
*/
127-
public static function orderDesc(String $id): string {
128-
return 'orderDesc("' . $id . '")';
127+
public static function orderDesc(String $attribute): string {
128+
return 'orderDesc("' . $attribute . '")';
129129
}
130130
131131
/**

tests/Base.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ abstract class Base extends TestCase
6161
const QUERY_HELPER_RESPONSES = [
6262
'equal("title", ["Spiderman","Dr. Strange"])',
6363
'notEqual("title", ["Spiderman"])',
64-
'lesser("releasedYear", [1990])',
65-
'greater("releasedYear", [1990,1999])',
64+
'lessThan("releasedYear", [1990])',
65+
'greaterThan("releasedYear", [1990,1999])',
6666
'search("name", ["john"])',
6767
'orderAsc("title")',
6868
'orderDesc("title")',

0 commit comments

Comments
 (0)