inveniosoftware-contrib / invenio-record-editor

Editor for Invenio records
GNU General Public License v2.0
0 stars 4 forks source link

Save endpoint view and test #6

Closed zzacharo closed 7 years ago

egabancho commented 8 years ago

Hey! Have you considered what I told you a few days ago about reusing invenio-records-rest?

I think it would be nice if you could take a look at it because you get most of the things you are doing (and not doing like access rights) for free.

cc @kaplun

kaplun commented 8 years ago

cc: @jmartinm

zzacharo commented 8 years ago

@egabancho I will check them today! I just started with something working using invenio-packages in general. I will take a look now!

jmartinm commented 8 years ago

@egabancho I agree that it would be nice to reuse as many parts of Invenio as possible, although I am not sure if directly using invenio-records-rest would be flexible enough as a backend for a record editor.

Let's say, for the save functionality in this PR, I guess the equivalent would be to call the patch method of invenio-records-rest. If am correct this method can only be called through http directly from the JS of the editor. So if we want to capture the validation errors and return a editor-friendly data structure we would have to modify such a function.

So what you mean is to reuse the helpers available in invenio-records-rest (similar to what deposit does? https://github.com/inveniosoftware/invenio-deposit/blob/master/invenio_deposit/views/rest.py#L38-L43 ) rather than directly using invenio-records-rest ? In which case I agree it can be a good idea to help fetching the record, permissions and so on.

jmartinm commented 7 years ago

Closing this since it is now outdated.