digitalfabrik / lunes-cms

The back end for the Lunes vocabulary trainer. Front end: https://github.com/digitalfabrik/lunes-app.
https://lunes.app
Apache License 2.0
20 stars 8 forks source link

Get documents by ids #324

Open steffenkleinle opened 2 years ago

steffenkleinle commented 2 years ago

Motivation

For several purposes like favorites we need to save documents in the app. While saving the whole documents is of course possible, there is no way of updating these if e.g. images, alternatives or the words of a document is changed. Fur us the better alternative would be to just save document ids and request the actual documents using a cms endpoint.

Proposed Solution

Implement an endpoint accepting one or multiple document ids and returns an array of the corresponding documents. If an id does not point to a valid document (anymore), the request should not fail but instead just not return a document for that id.

Alternatives

Additional Context

Corresponding app issue: https://issues.tuerantuer.org/browse/LUN-307

timobrembeck commented 2 years ago

Just to clarify, the new words endpoint does not satisfy your needs?

If it's really necessary to filter the documents by multiple ids, what is the preferred way for you to pass them? As GET-parameters, e.g. words/?ids[]=1&ids[]=2, words/?ids=1,2 or in the POST data as JSON list?

steffenkleinle commented 2 years ago

Ah yes, it does, sorry and thanks! Didn't know about that. I think it is necessary to filter by multiple ids. Query params would be my preferred way to do so. Is there documentation for the endpoints somewhere already?

timobrembeck commented 2 years ago

Alright! Yes, we do have documentations, in my opinion even a bit too many :see_no_evil::

@lukasboehm97 I think we should decide on a single source of truth, keep that one up to date and remove all other documentations.

batcapricorn commented 2 years ago

Ideally we would get our sphinx documentation up-to-date and keep it as single point of truth

batcapricorn commented 2 years ago

Summary of To-Do's regardings this issue: