X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2FREST%2F1.0%2Fcust_pkg;fp=httemplate%2FREST%2F1.0%2Fcust_pkg;h=3c58bcf319934fd51b022d4860d376b876043e5f;hp=0000000000000000000000000000000000000000;hb=5f8111de04a4a914c72a1642722476db4728339c;hpb=c7cc0522832d0e1c056f9bce46dd1b4b5551e612 diff --git a/httemplate/REST/1.0/cust_pkg b/httemplate/REST/1.0/cust_pkg new file mode 100644 index 000000000..3c58bcf31 --- /dev/null +++ b/httemplate/REST/1.0/cust_pkg @@ -0,0 +1,39 @@ +<% encode_rest($return) %>\ +<%init> + +rest_auth($cgi); + +my( $pkgnum, $command ) = split('/', rest_uri_remain($r, $m), 2 ); + +if ( $r->method eq 'GET' ) { + + my $return = []; + + if ( $pkgnum ) { + + my $cust_pkg = qsearchs('cust_main', { 'pkgnum'=>$pkgnum } ) + or die "unknown pkgnum $pkgnum"; + + if ( $command eq '' ) { + + $return = $cust_pkg->API_getinfo; + + } elsif ( $command eq 'cust_svc' ) { + + $return = [ map $_->API_getinfo, $cust_pkg->cust_svc ]; + + } + + + + #} else { #list + + } + +} elsif ( $r->method eq 'POST' ) { #create new + +} elsif ( $r->method eq 'PUT' ) { #modify + +} + +