Skip to content
Snippets Groups Projects
Verified Commit cbedd946 authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Zruseni namdatorniho filtru typu zpravy

parent 44077582
No related branches found
No related tags found
No related merge requests found
......@@ -47,16 +47,23 @@ sub list ($c) {
my ($cond, $attrs) = $c->search_parametrs( $args );
$cond->{type} = $args->{type};
if ( exists $args->{archived} && defined $args->{archived}) {
$cond->{is_archived} = $args->{archived};
}
# neschvalene navrhy postupu
# omezeni zobrazovani nepotvrzenych navrhu postupu
if ( $args->{type} ) {
$cond->{type} = $args->{type};
if ( $args->{type} == 0 && ! $c->user_roles->{chairman} ) {
$cond->{state} = {'-in' => [1,2,3,4]}
}
}
elsif (! $c->user_roles->{chairman}) {
$cond->{-or} => [
{ type => 1 },
{ state => { '-in' => [1,2,3,4] }},
];
}
my @posts = ();
......
......@@ -176,7 +176,7 @@ paths:
- name: type
in: query
description: "Typ zpravy"
required: true
required: false
schema:
type: integer
enum: [0, 1]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment