Skip to content

Commit 788ff6a

Browse files
committed
add new endpoint for updating sortingStrategy
1 parent 6bad6e7 commit 788ff6a

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
post:
2+
tags:
3+
- Compositions
4+
operationId: updateCompositionSortingStrategy
5+
x-acl:
6+
- editSettings
7+
summary: Update sortingStrategy for an existing composition
8+
description: |
9+
Update Update sortingStrategy for an existing composition in the current Algolia application.
10+
parameters:
11+
- $ref: '../urlParams.yml#/compositionID'
12+
requestBody:
13+
required: true
14+
content:
15+
application/json:
16+
schema:
17+
$ref: '../../common/schemas/components/Composition.yml#/sortingStrategy'
18+
responses:
19+
'200':
20+
description: OK
21+
content:
22+
application/json:
23+
schema:
24+
title: taskIDResponse
25+
type: object
26+
additionalProperties: false
27+
properties:
28+
taskID:
29+
$ref: '../../../common/responses/common.yml#/taskID'
30+
required:
31+
- taskID
32+
'400':
33+
$ref: '../../../common/responses/BadRequest.yml'
34+
'402':
35+
$ref: '../../../common/responses/FeatureNotEnabled.yml'
36+
'403':
37+
$ref: '../../../common/responses/MethodNotAllowed.yml'
38+
'404':
39+
$ref: '../../../common/responses/CompositionNotFound.yml'

specs/composition/spec.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ paths:
139139
$ref: 'paths/compositions/composition.yml'
140140
/1/compositions/*/batch:
141141
$ref: 'paths/compositions/batch.yml'
142+
/1/compositions/{compositionID}/sortingStrategy:
143+
$ref: 'paths/compositions/updateSortingStrategy.yml'
142144

143145
# ##########################################
144146
# ### Manage Composition Rules Endpoints ###
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[
2+
{
3+
"parameters": {
4+
"compositionID": "my-compo",
5+
"Price-asc": "products-low-to-high",
6+
"Price-desc": "products-high-to-low"
7+
},
8+
"request": {
9+
"path": "/1/compositions/my-compo/sortingStrategy",
10+
"method": "POST",
11+
"body": {
12+
"Price-asc": "products-low-to-high",
13+
"Price-desc": "products-high-to-low"
14+
}
15+
}
16+
}
17+
]

0 commit comments

Comments
 (0)