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