Rileybmcc / tea_time

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README

Screen Shot 2023-01-12 at 9 01 47 PM

Set up this back end service by running:

  • bundle install
  • rails db:{drop,create,migrate,seed}
  • Endpoint 1: New Subscription

    example call:

    POST "localhost:3000/api/v1/customers/1/subscriptions/create?title=Seasonal Mix&price=75.00&status=true&frequency=once a month&customer_id=1&tea_id=3"

    example response:

    { "outcome": "success", "data": { "id": 3, "title": "Seasonal Mix", "price": 75.0, "status": true, "frequency": "once a month", "customer_id": 1, "tea_id": 3, "created_at": "2023-01-13T07:07:47.846Z", "updated_at": "2023-01-13T07:07:47.846Z" } }

    Endpoint 2: Destroy Subscription

    example call:

    DELETE "localhost:3000/api/v1/customers/1/subscriptions/3"

    example response:

    { "outcome": "success", "data": {} }

    Endpoint 3: Show Users Subscriptions

    example call:

    GET "localhost:3000/api/v1/customers/2"

    example response:

    { "user": { "id": 2, "first_name": "Shawn", "last_name": "Spencer", "email": "ShawnS@gmail", "address": "1444 E 12th St", "created_at": "2023-01-12T22:23:43.862Z", "updated_at": "2023-01-12T22:23:43.862Z" }, "data": [] }

    About


    Languages

    Language:Ruby 99.4%Language:HTML 0.6%