MaxCunningham19 / legal_spellcheck

MVP Spellcheck for Legal Systems
3 stars 1 forks source link

Chinaza/add missing document put endpoint #109

Closed nassir90 closed 1 year ago

nassir90 commented 1 year ago

There is now a put endpoint that allows the contents of a document to be updated.

The behavior of this endpoint and the data schema it expects is described in serializers.py under the PutDocumentSerializer class.

This PR also includes tests to ensure that the update functionality actually works.

max-romagnoli commented 1 year ago

That's great looks all good.

I just have a question @nassir90: does the PUT endpoint maintain the ordering of documents inside the DB or create a new model with a different ID? As far as I know this behaviour was met in the old api/document/ that updated the title. In fact after the api request I was getting back a copy of the document with a different ID and so it was re-rendered at the end of the list.

nassir90 commented 1 year ago

I'm not sure what you mean. The document put endpoint didn't return anything other than 201 before? Could you give an example of the before / after json representation that you're talking about.