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

Create without adding to datastore #89

Closed
kenjiqq opened this issue Jul 8, 2014 · 3 comments
Closed

Create without adding to datastore #89

kenjiqq opened this issue Jul 8, 2014 · 3 comments
Assignees

Comments

@kenjiqq
Copy link

kenjiqq commented Jul 8, 2014

If you have an API that does not return the newly created object when you POST to the endpoint then angular-data craches because it tries to inject nothing into the datastore at the end of the create method. There should probably be an option or something to pass to create to make it not inject the result of the API call.

@kentcdodds
Copy link
Contributor

That would make sense to me. Do you think it would make more sense for that option to be on the defineResource object or on a per operation basis (like the options passed to DS when you try to create)?

@jmdobry jmdobry self-assigned this Jul 9, 2014
@jmdobry
Copy link
Member

jmdobry commented Jul 9, 2014

There is an option called cacheResponse which find, findAll, update, etc. support. I guess I forgot to add it to DS.create.

@kenjiqq
Copy link
Author

kenjiqq commented Jul 9, 2014

@kentcdodds probably makes more sense to have it pr operation, the same way this cacheResponse works. Since you might want to cache find to a resource but not create for instance. Or your would need multiple options on the defineResource object to handle setting these separately.

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

No branches or pull requests

3 participants