Skip to content

Commit

Permalink
Merge pull request #492 from wazo-platform/WAZO-3423-search-incalls-b…
Browse files Browse the repository at this point in the history
…y-userid

WAZO-3423 search incalls by user_id

Actual changes were done in the dao, this is only about documentation.

Reviewed-by: Alexandre Fournier
Reviewed-by: Francois Blackburn
Reviewed-by: rbienvenu0 <[email protected]>
  • Loading branch information
wazo-community-zuul[bot] authored Dec 18, 2024
2 parents bfd26bb + 398b07d commit ce3de00
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
20 changes: 20 additions & 0 deletions integration_tests/suite/base/test_incalls.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,26 @@ def test_sorting_offset_limit(incall1, incall2):
s.check_limit(url, incall1, incall2, 'description', 'sort')


@fixtures.incall(id=0)
@fixtures.user(id=0)
@fixtures.incall(id=1)
@fixtures.user(id=1)
def test_list_by_user_id(incall, user1, *_):
with a.incall_user(incall, user1):
response = confd.incalls().get()
assert_that(response.total, 2)

response = confd.incalls().get(user_id=user1['id'])
assert_that(response.total, 1)
assert_that(
response.items[0],
has_entry(
'destination',
has_entry('user_id', user1['id']),
),
)


@fixtures.incall()
def test_get(incall):
response = confd.incalls(incall['id']).get()
Expand Down
6 changes: 6 additions & 0 deletions wazo_confd/plugins/api/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ parameters:
name: agent_id
in: path
description: Agent’s ID
userid:
required: false
type: integer
name: user_id
in: query
description: the user's ID
useruuid:
required: true
type: string
Expand Down
1 change: 1 addition & 0 deletions wazo_confd/plugins/incall/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ paths:
- $ref: '#/parameters/limit'
- $ref: '#/parameters/offset'
- $ref: '#/parameters/search'
- $ref: '#/parameters/userid'
responses:
'200':
description: Incoming calls list
Expand Down

0 comments on commit ce3de00

Please sign in to comment.