View | Details | Raw Unified | Return to bug 18120
Collapse All | Expand All

(-)a/Koha/REST/V1/Acquisitions/Vendors.pm (-1 / +52 lines)
Lines 23-28 use Koha::Acquisition::Booksellers; Link Here
23
23
24
use Try::Tiny;
24
use Try::Tiny;
25
25
26
=head1 NAME
27
28
Koha::REST::V1::Acquisitions::Vendors
29
30
=head1 API
31
32
=head2 Methods
33
34
=head3 list_vendors
35
36
Controller function that handles listing Koha::Acquisition::Bookseller objects
37
38
=cut
39
26
sub list_vendors {
40
sub list_vendors {
27
    my $c = shift->openapi->valid_input or return;
41
    my $c = shift->openapi->valid_input or return;
28
42
Lines 54-59 sub list_vendors { Link Here
54
    };
68
    };
55
}
69
}
56
70
71
=head3 get_vendor
72
73
Controller function that handles retrieving a single Koha::Acquisition::Bookseller
74
75
=cut
76
57
sub get_vendor {
77
sub get_vendor {
58
    my $c = shift->openapi->valid_input or return;
78
    my $c = shift->openapi->valid_input or return;
59
79
Lines 67-72 sub get_vendor { Link Here
67
                       openapi => _to_api($vendor->TO_JSON) );
87
                       openapi => _to_api($vendor->TO_JSON) );
68
}
88
}
69
89
90
=head3 add_vendor
91
92
Controller function that handles adding a new Koha::Acquisition::Bookseller object
93
94
=cut
95
70
sub add_vendor {
96
sub add_vendor {
71
    my $c = shift->openapi->valid_input or return;
97
    my $c = shift->openapi->valid_input or return;
72
98
Lines 89-94 sub add_vendor { Link Here
89
    };
115
    };
90
}
116
}
91
117
118
=head3 update_vendor
119
120
Controller function that handles updating a Koha::Acquisition::Bookseller object
121
122
=cut
123
92
sub update_vendor {
124
sub update_vendor {
93
    my $c = shift->openapi->valid_input or return;
125
    my $c = shift->openapi->valid_input or return;
94
126
Lines 118-123 sub update_vendor { Link Here
118
150
119
}
151
}
120
152
153
=head3 delete_vendor
154
155
Controller function that handles deleting a Koha::Acquisition::Bookseller object
156
157
=cut
158
121
sub delete_vendor {
159
sub delete_vendor {
122
    my $c = shift->openapi->valid_input or return;
160
    my $c = shift->openapi->valid_input or return;
123
161
Lines 146-151 sub delete_vendor { Link Here
146
184
147
}
185
}
148
186
187
=head3 _to_api
188
189
Helper function that maps a Koha::Acquisition::Bookseller object into
190
the attribute names the exposed REST api spec.
191
192
=cut
193
149
sub _to_api {
194
sub _to_api {
150
195
151
    my $vendor = shift;
196
    my $vendor = shift;
Lines 174-179 sub _to_api { Link Here
174
    return $vendor;
219
    return $vendor;
175
}
220
}
176
221
222
=head3 _to_model
223
224
Helper function that maps REST api objects into Koha::Acquisition::Bookseller
225
attribute names.
226
227
=cut
228
177
sub _to_model {
229
sub _to_model {
178
    my $vendor_param = shift;
230
    my $vendor_param = shift;
179
231
180
- 

Return to bug 18120