Feat/lottery endpoint #18

Merged
KevinMidboe merged 8 commits from feat/lottery-endpoint into master 2020-08-14 14:56:48 +00:00
KevinMidboe commented 2020-06-14 11:53:24 +00:00 (Migrated from github.com)

Frontend

TODO:

  • List all previous lotteries at endpoint /history.
  • better visualisation that doesn't use the Winners component.
  • alternative detailed view for a specific lottery.
  • view history/wins by name.

Frontend has a /history [0] page that fetches all previous lotteries sorted by date and it's winners.

Backend

Get information per lottery.

New endpoints:

  • /lottery/all,
  • /lottery/by-date/:date where :date is seconds i epoch format, and
  • /lottery/by-name/:name where :name is string of person want to get winning lotteries for.

The response object looks like. Note that wine is only the Object Id when using /lottery/all, but the other endpoints resolves the win.wine to it's full object.

{
  name: user.name,
  color: win.color,
  wine: win.wine,
  date: epochDate
}

[0]
Screenshot 2020-06-14 at 14 25 06

# Frontend TODO: - [x] List all previous lotteries at endpoint /history. - [ ] better visualisation that doesn't use the Winners component. - [ ] alternative detailed view for a specific lottery. - [ ] view history/wins by name. Frontend has a `/history` [0] page that fetches all previous lotteries sorted by date and it's winners. # Backend Get information per lottery. New endpoints: - `/lottery/all`, - `/lottery/by-date/:date` where `:date` is seconds i epoch format, and - `/lottery/by-name/:name` where `:name` is string of person want to get winning lotteries for. The response object looks like. Note that `wine` is only the Object Id when using `/lottery/all`, but the other endpoints resolves the `win.wine` to it's full object. ```javascript { name: user.name, color: win.color, wine: win.wine, date: epochDate } ``` [0] ![Screenshot 2020-06-14 at 14 25 06](https://user-images.githubusercontent.com/2287769/84593382-482ede00-ae4c-11ea-9ec4-b8da00109192.png)
Sign in to join this conversation.
No description provided.