Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create or update #123

Open
victorsferreira opened this issue Jun 5, 2017 · 0 comments
Open

Can't create or update #123

victorsferreira opened this issue Jun 5, 2017 · 0 comments

Comments

@victorsferreira
Copy link

victorsferreira commented Jun 5, 2017

I followed the steps in the documentation to create a Clients collection and although I can read the collection and its items (/clients and /clients/:id) I can't POST or PUT to it.

It gives me a generic error:

DataException in DataObject.php line 66:
An error with the provided data occured.

Going to that line and printing the $errorBag variable I get this:

object(NilPortugues\Api\JsonApi\Server\Errors\ErrorBag)#194 (2) { ["errors":protected]=> array(1) { [0]=> object(NilPortugues\Api\JsonApi\Server\Errors\InvalidTypeError)#210 (8) { ["id":protected]=> NULL ["links":protected]=> array(0) { } ["status":protected]=> NULL ["code":protected]=> string(22) "resource_not_supported" ["title":protected]=> string(18) "Unsupported Action" ["detail":protected]=> string(38) "Resource type clients not supported." ["source":protected]=> array(1) { ["pointer"]=> string(5) "/data" } ["meta":protected]=> NULL } } ["httpCode":protected]=> NULL }

So it says "Unsupported Action" and "Resource type clients not supported.", what am I missing?

So I probably did something wrong or skipped a step in the configuration of the api.

Anyone knows what happened?

Extra info

at DataObject::assertPost(array('type' => 'clients', 'attributes' => array('cpf' => '123', 'email' => '123', 'name' => '123', 'created_at' => '2017-06-05 05:34:50', 'updated_at' => '2017-06-05 05:34:50', 'deleted_at' => '2017-06-02 04:54:30')), object(JsonApiSerializer), 'App\Model\Database\Clients', object(ErrorBag)) in CreateResource.php line 58

I'm using Axios to send a request from a react spa. I configured CORS and I'm already getting things from the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant