Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Support for list patch on CrudResource #35

Open
robinmaben opened this issue Mar 7, 2016 · 5 comments
Open

Support for list patch on CrudResource #35

robinmaben opened this issue Mar 7, 2016 · 5 comments

Comments

@robinmaben
Copy link

Scenario -

Update multiple objects for resource in single go.

  1. GET - list
  2. CREATE - list
  3. UPDATE - list
  4. CREATE_OR_UPDATE - list (like an upsert)

4 is a nice to have. While 2 and 3 are what's missing today. The way to do this today is to write a CrudResource for GET and a CommandResource for the others.

@robinmaben
Copy link
Author

@uttamk @vedarthk @vinodkumaar - I've heard of previous instances where such a need arose. Please elaborate if you can recall those scenarios?

@uttamk
Copy link
Contributor

uttamk commented Mar 7, 2016

What will the url look like for create_list ?

@robinmaben
Copy link
Author

@uttamk Right now it's simply - POST api/v1/list_resource_name with some filter_id as a param.

@uttamk
Copy link
Contributor

uttamk commented Mar 7, 2016

@robinmaben it would be nice if you gave a little more context about the requirement ... and why using the existing CommandResource does not work for you

@vedarthk
Copy link
Member

vedarthk commented Mar 8, 2016

@robinmaben There are multiple things which are rigid right now, if we want to enable patch on list of objects. Right now defining schema is the only way of getting structured data from request for most of the cases this will solve the problem of sending data for list patch.

In my opinion, we can implement this as follows:

  • add UPDATE_LIST action
  • above action should require implementation of update_list method which will take list of serialized data as argument
  • and the method should return list of objects with updated fields and existing fields.

CommandResource is a temporary workaround to achieve this.

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

No branches or pull requests

3 participants