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

Get documents by ids #324

Open
steffenkleinle opened this issue Apr 13, 2022 · 5 comments
Open

Get documents by ids #324

steffenkleinle opened this issue Apr 13, 2022 · 5 comments

Comments

@steffenkleinle
Copy link
Member

steffenkleinle commented Apr 13, 2022

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
Copy link
Member

timobrembeck commented Apr 13, 2022

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
Copy link
Member Author

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
Copy link
Member

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

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

@batcapricorn
Copy link
Contributor

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

@batcapricorn
Copy link
Contributor

Summary of To-Do's regardings this issue:

  • currently, we have two similar endpoints discipline_by_id (which is only used internally within the cms GUI) and words. It makes sense to merge these endpoints into one
  • handle access rights (API-Token, Authentication for replacing discipline_by_id etc.)
  • set up filtering and url-creation

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

No branches or pull requests

3 participants