feat: Sort contacts via name, email, phone_number, last_activity_at (#1870)
This commit is contained in:
15
swagger/parameters/contact_sort.yml
Normal file
15
swagger/parameters/contact_sort.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
in: query
|
||||
name: sort
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- name
|
||||
- email
|
||||
- phone_number
|
||||
- last_activity_at
|
||||
- -name
|
||||
- -email
|
||||
- -phone_number
|
||||
- -last_activity_at
|
||||
required: false
|
||||
description: The attribute by which list should be sorted
|
||||
@@ -4,7 +4,6 @@ account_id:
|
||||
team_id:
|
||||
$ref: ./team_id.yml
|
||||
|
||||
|
||||
source_id:
|
||||
$ref: ./source_id.yml
|
||||
|
||||
@@ -14,3 +13,8 @@ conversation_id:
|
||||
message_id:
|
||||
$ref: ./message_id.yml
|
||||
|
||||
contact_sort_param:
|
||||
$ref: ./contact_sort.yml
|
||||
|
||||
page:
|
||||
$ref: ./page.yml
|
||||
|
||||
7
swagger/parameters/page.yml
Normal file
7
swagger/parameters/page.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
in: query
|
||||
name: page
|
||||
schema:
|
||||
type: integer
|
||||
default: 1
|
||||
required: false
|
||||
description: The page parameter
|
||||
@@ -2,12 +2,11 @@ get:
|
||||
tags:
|
||||
- Contact
|
||||
operationId: contactList
|
||||
description: Listing all the contacts with pagination
|
||||
description: Listing all the contacts with pagination (Page size = 15)
|
||||
summary: List Contacts
|
||||
parameters:
|
||||
- name: query_hash
|
||||
in: query
|
||||
type: string
|
||||
- $ref: '#/parameters/contact_sort_param'
|
||||
- $ref: '#/parameters/page'
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
|
||||
@@ -2,12 +2,14 @@ get:
|
||||
tags:
|
||||
- Contact
|
||||
operationId: contactSearch
|
||||
description: Search the contacts using a search key, currently supports email search
|
||||
description: Search the contacts using a search key, currently supports email search (Page size = 15)
|
||||
summary: Search Contacts
|
||||
parameters:
|
||||
- name: q
|
||||
in: query
|
||||
type: string
|
||||
- $ref: '#/parameters/contact_sort_param'
|
||||
- $ref: '#/parameters/page'
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
|
||||
@@ -887,13 +887,14 @@
|
||||
"Contact"
|
||||
],
|
||||
"operationId": "contactList",
|
||||
"description": "Listing all the contacts with pagination",
|
||||
"description": "Listing all the contacts with pagination (Page size = 15)",
|
||||
"summary": "List Contacts",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "query_hash",
|
||||
"in": "query",
|
||||
"type": "string"
|
||||
"$ref": "#/parameters/contact_sort_param"
|
||||
},
|
||||
{
|
||||
"$ref": "#/parameters/page"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -1052,13 +1053,19 @@
|
||||
"Contact"
|
||||
],
|
||||
"operationId": "contactSearch",
|
||||
"description": "Search the contacts using a search key, currently supports email search",
|
||||
"description": "Search the contacts using a search key, currently supports email search (Page size = 15)",
|
||||
"summary": "Search Contacts",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "q",
|
||||
"in": "query",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"$ref": "#/parameters/contact_sort_param"
|
||||
},
|
||||
{
|
||||
"$ref": "#/parameters/page"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -2083,6 +2090,35 @@
|
||||
},
|
||||
"required": true,
|
||||
"description": "The numeric ID of the message"
|
||||
},
|
||||
"contact_sort_param": {
|
||||
"in": "query",
|
||||
"name": "sort",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"name",
|
||||
"email",
|
||||
"phone_number",
|
||||
"last_activity_at",
|
||||
"-name",
|
||||
"-email",
|
||||
"-phone_number",
|
||||
"-last_activity_at"
|
||||
]
|
||||
},
|
||||
"required": false,
|
||||
"description": "The attribute by which list should be sorted"
|
||||
},
|
||||
"page": {
|
||||
"in": "query",
|
||||
"name": "page",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"default": 1
|
||||
},
|
||||
"required": false,
|
||||
"description": "The page parameter"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user