@@ -93,7 +93,7 @@ public OrdersController(FaunaClient client) {
9393 Future <Order > get (@ PathVariable String id ) {
9494 var args = Map .of ("id" , id , "response" , response );
9595 var q = fql ("""
96- let order: Any = Order.byId(${id})!
96+ let order = Order.byId(${id})!
9797 ${response}
9898 """ , args );
9999
@@ -118,7 +118,7 @@ Future<Order> update(@PathVariable String id, @RequestBody OrderUpdate req) {
118118 // as the order status.
119119 query = fql ("""
120120 let req = ${req}
121- let order: Any = checkout(${id}, req.status, req.payment)
121+ let order = checkout(${id}, req.status, req.payment)
122122 ${response}
123123 """ , args );
124124 } else {
@@ -127,7 +127,7 @@ Future<Order> update(@PathVariable String id, @RequestBody OrderUpdate req) {
127127 // error. We then use the validateOrderStatusTransition UDF to ensure that the order status transition
128128 // is valid. If the transition is not valid, the UDF will throw an abort error.
129129 query = fql ("""
130- let order: Any = Order.byId(${id})!
130+ let order = Order.byId(${id})!
131131 let req = ${req}
132132
133133 // Validate the order status transition if a status is provided.
@@ -162,7 +162,7 @@ Future<Page<Order>> getByCustomer(@PathVariable("id") String customerId, @Reques
162162 if (afterToken != null ) {
163163 /**
164164 * The `afterToken` parameter contains a Fauna `after` cursor.
165- * `after` cursors may contain special characters, such as `.` or `+`).
165+ * `after` cursors may contain special characters, such as `.` or `+`).
166166 * Make sure to URL encode the `afterToken` value to preserve these
167167 * characters in URLs.
168168 */
@@ -177,10 +177,8 @@ Future<Page<Order>> getByCustomer(@PathVariable("id") String customerId, @Reques
177177 // the results to return only the fields we care about.
178178 var args = Map .of ("customerId" , customerId ,"pageSize" , pageSize ,"response" , response );
179179 query = fql ("""
180- let customer: Any = Customer.byId(${customerId})!
180+ let customer = Customer.byId(${customerId})!
181181 Order.byCustomer(customer).pageSize(${pageSize}).map((order) => {
182- let order: Any = order
183-
184182 // Return the order.
185183 ${response}
186184 })
@@ -201,7 +199,7 @@ Future<Order> createCart(@PathVariable("id") String customerId) {
201199 // definition can be found 'server/schema/functions.fsl'.
202200 Map <String , Object > args = Map .of ("customerId" , customerId , "response" , response );
203201 Query query = fql ("""
204- let order: Any = getOrCreateCart(${customerId})
202+ let order = getOrCreateCart(${customerId})
205203
206204 // Return the cart.
207205 ${response}
@@ -223,7 +221,7 @@ Future<Order> addToCart(@PathVariable("id") String customerId, @RequestBody AddT
223221 Map <String , Object > args = Map .of ("customerId" , customerId , "req" , req , "response" , response );
224222 Query query = fql ("""
225223 let req = ${req}
226- let order: Any = createOrUpdateCartItem(${customerId}, req.productName, req.quantity)
224+ let order = createOrUpdateCartItem(${customerId}, req.productName, req.quantity)
227225
228226 // Return the cart as an OrderResponse object.
229227 ${response}
@@ -244,7 +242,7 @@ Future<Order> getCart(@PathVariable("id") String customerId) {
244242 // If the document does not exist, Fauna will throw a document_not_found error.
245243 Map <String , Object > args = Map .of ("customerId" , customerId , "response" , response );
246244 Query query = fql ("""
247- let order: Any = Customer.byId(${customerId})!.cart
245+ let order = Customer.byId(${customerId})!.cart
248246
249247 // Return the cart as an OrderResponse object.
250248 ${response}
0 commit comments