File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
src/main/kotlin/com/ctrlhub/core/datacapture Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,6 @@ runBlocking {
94
94
95
95
api.applySessionToken(response.sessionToken)
96
96
val vehicles = api.vehicles.all(" org-123" )
97
- println (vehicles.size)
97
+ println (vehicles.data. size)
98
98
}
99
99
```
Original file line number Diff line number Diff line change @@ -7,7 +7,18 @@ import com.ctrlhub.core.router.Router
7
7
import com.ctrlhub.core.router.request.RequestParameters
8
8
import io.ktor.client.HttpClient
9
9
10
+ /* *
11
+ * A router that interacts with the forms realm of the Ctrl Hub API
12
+ */
10
13
class FormsRouter (httpClient : HttpClient ) : Router(httpClient) {
14
+
15
+ /* *
16
+ * Retrieve a list of all forms
17
+ *
18
+ * @param organisationId String The organisation ID to retrieve all forms for
19
+ *
20
+ * @return A list of all forms
21
+ */
11
22
suspend fun all (
12
23
organisationId : String ,
13
24
requestParameters : RequestParameters = RequestParameters ()
@@ -19,6 +30,13 @@ class FormsRouter(httpClient: HttpClient) : Router(httpClient) {
19
30
)
20
31
}
21
32
33
+ /* *
34
+ * Fetch a single form by ID
35
+ *
36
+ * @param organisationId String The organisation ID to retrieve a single form for
37
+ *
38
+ * @return FOrm
39
+ */
22
40
suspend fun one (organisationId : String , formId : String ): Form {
23
41
return fetchJsonApiResource(" /v3/orgs/${organisationId} /data-capture-forms/${formId} " )
24
42
}
You can’t perform that action at this time.
0 commit comments