use CGI::Expand ();
use DBIx::Class::ResultClass::HashRefInflator;
-use JSON;
+use JSON ();
use Test::Deep::NoTest('eq_deeply');
use MooseX::Types::Moose(':all');
use Moose::Util;
sub push_error
{
my ( $self, $c, $params ) = @_;
+ die 'Catalyst app object missing'
+ unless defined $c;
my $error = 'unknown error';
if (exists $params->{message}) {
$error = $params->{message};
sub get_errors
{
my ( $self, $c ) = @_;
+ die 'Catalyst app object missing'
+ unless defined $c;
return $c->stash->{_dbic_crud_errors};
}
+=method_protected has_errors
+
+returns returns true if errors are stored in the stash
+
+=cut
+
+sub has_errors {
+ my ( $self, $c ) = @_;
+ die 'Catalyst app object missing'
+ unless defined $c;
+ return exists $c->stash->{_dbic_crud_errors};
+}
+
=head1 DESCRIPTION
Easily provide common API endpoints based on your L<DBIx::Class> schema classes. Module provides both RPC and REST interfaces to base functionality. Uses L<Catalyst::Action::Serialize> and L<Catalyst::Action::Deserialize> to serialise response and/or deserialise request.