RoySegall / dev_days_restful_example

0 stars 0 forks source link

Invert relationship between board and message #1

Open DavidHernandez opened 7 years ago

DavidHernandez commented 7 years ago

For the frontend, makes more sense to have an inverted relationship between a board and the messages. Instead of a Message related to a Board, we have a Board that contains a list of messages. We also need to add the list of messages to the Board restful output.

Maybe we do not need to change the fields and we can just add a query to load all the messages that belong to a board.

RoySegall commented 7 years ago

If I'm looking on OG then the OG membership reference group content to group lie a board message reference to a board.

We can show another feature of restful that allow us to filter board messages from the query string of the address: /api/board_messages?filter[field][board][]=1 or something like that. I don't remember the syntax.