| 1 | package Daje::Controller::ToolsParameterValues; | ||
| 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 | sub load_parameter_value ($self) { | ||
| 40 | |||
| 41 | |||
| 42 | $self->render_later; | ||
| 43 | # my ($companies_pkey, $users_pkey) = $self->jwt->companies_users_pkey( | ||
| 44 | # $self->req->headers->header('X-Token-Check') | ||
| 45 | # ); | ||
| 46 | my $tools_projects_fkey = $self->param('tools_projects_fkey'); | ||
| 47 | my $tools_parameters_fkey = $self->param('tools_parameters_fkey'); | ||
| 48 | |||
| 49 | # my $setting = $self->param('setting'); | ||
| 50 | $self->tools_parameter_values->load_tools_parameters_values_project_parameter_fkey( | ||
| 51 | $tools_projects_fkey, $tools_parameters_fkey | ||
| 52 | )->then(sub($result) { | ||
| 53 | $self->render(json => $result->{data}); | ||
| 54 | })->catch(sub($err) { | ||
| 55 | $self->app->log->debug('Daje::Controller::ToolsParameterValues::load_parameter_value ' . $err); | ||
| 56 | $self->render(json => { 'result' => 0, data => $err }); | ||
| 57 | })->wait; | ||
| 58 | } | ||
| 59 | |||
| 60 | |||
| 61 | |||
| 62 | |||
| 63 | 1; | ||
| 64 | |||
| 65 | #################### pod generated by Pod::Autopod - keep this line to make pod updates possible #################### | ||
| 66 | |||
| 67 | =head1 NAME | ||
| 68 | |||
| 69 | |||
| 70 | Daje::Controller::Tools - Mojolicious Plugin | ||
| 71 | |||
| 72 | |||
| 73 | |||
| 74 | =head1 SYNOPSIS | ||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | |||
| 79 | |||
| 80 | |||
| 81 | =head1 DESCRIPTION | ||
| 82 | |||
| 83 | |||
| 84 | Daje::Controller::Tools is a Mojolicious plugin. | ||
| 85 | |||
| 86 | |||
| 87 | |||
| 88 | =head1 REQUIRES | ||
| 89 | |||
| 90 | L<Data::Dumper> | ||
| 91 | |||
| 92 | L<v5.40> | ||
| 93 | |||
| 94 | L<Mojo::Base> | ||
| 95 | |||
| 96 | |||
| 97 | =head1 METHODS | ||
| 98 | |||
| 99 | |||
| 100 | Register plugin in L<Mojolicious> application. | ||
| 101 | |||
| 102 | |||
| 103 | |||
| 104 | =head1 AUTHOR | ||
| 105 | |||
| 106 | |||
| 107 | janeskil1525 E<lt>janeskil1525@gmail.com | ||
| 108 | |||
| 109 | |||
| 110 | |||
| 111 | =head1 LICENSE | ||
| 112 | |||
| 113 | |||
| 114 | Copyright (C) janeskil1525. | ||
| 115 | |||
| 116 | This library is free software; you can redistribute it and/or modify | ||
| 117 | it under the same terms as Perl itself. | ||
| 118 | |||
| 119 | |||
| 120 | |||
| 121 | =cut | ||
| 122 |