mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Update orders swagger spec and fix api_key access to orders endpoint
This commit is contained in:
@@ -8,7 +8,7 @@ module Api
|
||||
def index
|
||||
authorize! :admin, Spree::Order
|
||||
|
||||
search_results = SearchOrders.new(params, spree_current_user)
|
||||
search_results = SearchOrders.new(params, current_api_user)
|
||||
|
||||
render json: {
|
||||
orders: serialized_orders(search_results.orders),
|
||||
|
||||
53
swagger.yaml
53
swagger.yaml
@@ -342,9 +342,60 @@ paths:
|
||||
|
||||
/orders:
|
||||
get:
|
||||
description: Gets all Orders.
|
||||
description: Gets all Orders. Use combinations of parameters to filter your query. For example /api/orders?q[completed_at_gt]=2020_02_02&q[completed_at_lt]=2020_02_10 returns orders between 2nd and 10th February 2020.
|
||||
tags:
|
||||
- orders
|
||||
parameters:
|
||||
- in: query
|
||||
name: q[distributor_id_eq]
|
||||
schema:
|
||||
type: string
|
||||
style: deepObject
|
||||
description: Query orders for a specific distributor id.
|
||||
required: false
|
||||
- in: query
|
||||
name: q[completed_at_gt]
|
||||
schema:
|
||||
type: string
|
||||
style: deepObject
|
||||
description: Query orders completed after a date.
|
||||
required: false
|
||||
- in: query
|
||||
name: q[completed_at_lt]
|
||||
schema:
|
||||
type: string
|
||||
style: deepObject
|
||||
description: Query orders completed before a date.
|
||||
required: false
|
||||
- in: query
|
||||
name: q[state_eq]
|
||||
schema:
|
||||
type: string
|
||||
style: deepObject
|
||||
description: Query orders by order state, eg 'cart', 'complete'.
|
||||
required: false
|
||||
- in: query
|
||||
name: q[payment_state_eq]
|
||||
schema:
|
||||
type: string
|
||||
style: deepObject
|
||||
description: Query orders by order payment_state, eg 'balance_due', 'paid', 'failed'.
|
||||
required: false
|
||||
- in: query
|
||||
name: q[email_cont]
|
||||
schema:
|
||||
type: string
|
||||
style: deepObject
|
||||
description: Query orders where the order email contains a string.
|
||||
required: false
|
||||
- in: query
|
||||
name: q[order_cycle_id_eq]
|
||||
schema:
|
||||
type: string
|
||||
style: deepObject
|
||||
description: Query orders for a specific order_cycle id.
|
||||
required: false
|
||||
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
|
||||
Reference in New Issue
Block a user