From f56c48b83d2d90927a69c1f0fd7e952e91204903 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Mon, 31 Dec 2018 23:21:44 +0000 Subject: [PATCH] fixes to SQL and api spec --- lib/App/Netdisco/DB/Result/Virtual/UserRole.pm | 4 ++-- lib/App/Netdisco/Util/API.pm | 4 ++-- lib/App/Netdisco/Web/Plugin/API/NodeIP.pm | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/App/Netdisco/DB/Result/Virtual/UserRole.pm b/lib/App/Netdisco/DB/Result/Virtual/UserRole.pm index 7746112e..af960260 100644 --- a/lib/App/Netdisco/DB/Result/Virtual/UserRole.pm +++ b/lib/App/Netdisco/DB/Result/Virtual/UserRole.pm @@ -20,8 +20,8 @@ __PACKAGE__->result_source_instance->view_definition(<{partial} || 0; + my $partial = $params->{partial} || false; foreach my $param (keys %{$params}) { if ($param ne 'return_url' and $param ne 'partial') { - if ($partial == 1) { + if ($partial eq 'true') { $search->{"text(".$param.")"} = { -ilike => '%'.$params->{$param}.'%'}; } else { diff --git a/lib/App/Netdisco/Web/Plugin/API/NodeIP.pm b/lib/App/Netdisco/Web/Plugin/API/NodeIP.pm index 7c34f54a..35fef288 100644 --- a/lib/App/Netdisco/Web/Plugin/API/NodeIP.pm +++ b/lib/App/Netdisco/Web/Plugin/API/NodeIP.pm @@ -25,6 +25,9 @@ swagger_path { description => 'All parameters will be searched for case insensitively in their values', }, ], + responses => { + default => { description => 'A row from the node_ip table' }, + }, }, get '/api/nodeip/search' => require_role api => sub { my $para = params;