allow creating multiple related columns when updating or creating new records
[catagits/Catalyst-Controller-DBIC-API.git] / t / lib / RestTest / Controller / API / REST / Artist.pm
index 3dad378..ea5a4bc 100644 (file)
@@ -7,9 +7,15 @@ __PACKAGE__->config
     ( action => { setup => { PathPart => 'artist', Chained => '/api/rest/rest_base' } },
       class => 'RestTestDB::Artist',
       create_requires => ['name'],
-      create_allows => ['name'],
-      update_allows => ['name'],
+      create_allows => ['name', { cds => ['*'] }],
+      update_allows => ['name', { cds => ['*'] }],
       prefetch_allows => [[qw/ cds /],{ 'cds' => 'tracks'}],
       );
 
+sub action_with_error : Chained('objects_no_id') PathPart('action_with_error') Args(0) {
+    my ( $self, $c ) = @_;
+
+    $c->res->status(404);
+}
+
 1;