#57 I can filter articles by workgroup

update lib "postgres-json:1.2.1"
This commit is contained in:
2020-08-24 15:58:48 +02:00
parent 01c3d85a17
commit 16feab9655
19 changed files with 125 additions and 32 deletions

View File

@@ -218,6 +218,14 @@ paths:
- $ref: '#/components/parameters/direction'
- $ref: '#/components/parameters/search'
- $ref: '#/components/parameters/createdBy'
- name: workgroup
in: query
description: ID of workgroup
example: 82a0e60a-bb55-dbc0-1c3d-0a804df2b5df
required: false
schema:
type: string
format: uuid
responses:
200:
description: The Article objects

View File

@@ -15,6 +15,7 @@ begin
from article a
where (_search is null or _search = '' or a ==> dsl.multi_match('{title^3, content, description, tags}', _search))
and (_filter->>'created_by_id' is null or a.created_by_id = (_filter->>'created_by_id')::uuid)
and (_filter->>'workgroup_id' is null or a.workgroup_id = (_filter->>'workgroup_id')::uuid)
and a.last_version = true
)
into resource, total
@@ -33,6 +34,7 @@ begin
or a ==> dsl.multi_match('{title^3, content, description, tags}', _search)
)
and (_filter->>'created_by_id' is null or a.created_by_id = (_filter->>'created_by_id')::uuid)
and (_filter->>'workgroup_id' is null or a.workgroup_id = (_filter->>'workgroup_id')::uuid)
and a.last_version = true
order by