Controller/ToolsTreelist.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 24 CC 1 SCAR 6.9
CC
1
Cov
0%
load_treelist
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Daje::Controller::ToolsTreelist;
2 use Mojo::Base 'Mojolicious::Controller', -signatures;
3 use v5.42;
4  
5  
6 # NAME
7 # ====
8 #
9 # Daje::Controller::Tools - Mojolicious Plugin
10 #
11 # SYNOPSIS
12 # ========
13 #
14 #
15 #
16 # DESCRIPTION
17 # ===========
18 #
19 # Daje::Controller::Tools is a Mojolicious plugin.
20 #
21 # METHODS
22 # =======
23 #
24 # Register plugin in L<Mojolicious> application.
25 #
26 # LICENSE
27 # =======
28 #
29 # Copyright (C) janeskil1525.
30 #
31 # This library is free software; you can redistribute it and/or modify
32 # it under the same terms as Perl itself.
33 #
34 # AUTHOR
35 # ======
36 #
37 # janeskil1525 E<lt>janeskil1525@gmail.com
38 #
39  
40 use Data::Dumper;
41  
42 sub load_treelist($self) {
43  
44 $self->app->log->debug('Daje::Controller::ToolsTreelist::load_treelist');
45 $self->render_later;
46 my $tools_projects_pkey = $self->param('tools_projects_pkey');
47  
48 $self->tools_helper_treelist->load_treelist($tools_projects_pkey)->then(sub ($result){
49 $self->render(json => $result->{data});
50 })->catch(sub ($err) {
51 $self->app->log->error('Daje::Controller::ToolsTreelist::load_treelist ' . $err);
52 $self->render(json => { 'result' => 0, data => $err });
53 });
54 }
55  
56 1;
57 #################### pod generated by Pod::Autopod - keep this line to make pod updates possible ####################
58  
59 =head1 NAME
60  
61  
62 Daje::Controller::Tools - Mojolicious Plugin
63  
64  
65  
66 =head1 SYNOPSIS
67  
68  
69  
70  
71  
72  
73 =head1 DESCRIPTION
74  
75  
76 Daje::Controller::Tools is a Mojolicious plugin.
77  
78  
79  
80 =head1 REQUIRES
81  
82 L<Data::Dumper>
83  
84 L<v5.42>
85  
86 L<Mojo::Base>
87  
88  
89 =head1 METHODS
90  
91  
92 Register plugin in L<Mojolicious> application.
93  
94  
95  
96 =head1 AUTHOR
97  
98  
99 janeskil1525 E<lt>janeskil1525@gmail.com
100  
101  
102  
103 =head1 LICENSE
104  
105  
106 Copyright (C) janeskil1525.
107  
108 This library is free software; you can redistribute it and/or modify
109 it under the same terms as Perl itself.
110  
111  
112  
113 =cut
114