summaryrefslogtreecommitdiff
path: root/LedgerSMB/RESTXML/Document/Part.pm
blob: 072f9b80982fab89b0cd06af6a2baefc82256495 (plain)
  1. package LedgerSMB::RESTXML::Document::Part;
  2. use strict;
  3. use warnings;
  4. use base qw(LedgerSMB::RESTXML::Document::Base);
  5. sub handle_get {
  6. my ($self, $args) = @_;
  7. my $user = $args->{user};
  8. my $dbh = $args->{dbh};
  9. my $handler = $args->{handler};
  10. my $res = $dbh->selectrow_hashref(q{SELECT * from part where id = ?}, undef, $args->{args}[0]);
  11. if(!$res) {
  12. $handler->not_found("No part with the id $args->{args}[0] found");
  13. } else {
  14. $handler->respond($self->hash_to_twig({name=>'Customer',hash=>$res}));
  15. }
  16. }
  17. 1;