What:I want to be able to get messages with specific criteria
Why:so that we can show those messages
Implementation details
Create the GET endpoint for /api/messages
It should be possible to filter the messages in the following way:
Words, fx /api/messages?query=bananas returns all the message that mentions bananas
Channel id, fx /api/messages?channel-id=32 get all the messages from the channel with id 32
Message creator based on either email or user id /api/messages?sender=benjamin.dals.hughes@gmail.com get all the messages from the user with email benjamin.dals.hughes@gmail.com
Limit: /api/messages?limit=10 get the latest 10 messages
Sorting: /api/messages?sort=desc&sort-by=date Sort the messages descending regarding the dates
Remember to split the story into smaller PR's! Maybe you can do a PR with just the words, filter fx. You can also choose to do it in seperate commits. just be very aware of the PR's not becoming too big!
User story
Who: As a developer
What: I want to be able to get messages with specific criteria
Why: so that we can show those messages
Implementation details
GET
endpoint for/api/messages
It should be possible to filter the messages in the following way:
/api/messages?query=bananas
returns all the message that mentions bananas/api/messages?channel-id=32
get all the messages from the channel with id 32/api/messages?sender=benjamin.dals.hughes@gmail.com
get all the messages from the user with email benjamin.dals.hughes@gmail.com/api/messages?limit=10
get the latest 10 messages/api/messages?sort=desc&sort-by=date
Sort the messages descending regarding the datesRemember to split the story into smaller PR's! Maybe you can do a PR with just the words, filter fx. You can also choose to do it in seperate commits. just be very aware of the PR's not becoming too big!