nicorithner / rails_engine

Turing Module 3 - Api rails app exercise
0 stars 0 forks source link

Destroy Record End Point #7

Closed nicorithner closed 3 years ago

nicorithner commented 3 years ago

2a. ReST Endpoints

You will need to expose Restful API endpoints for both Items and Merchants.

The endpoints you need to expose are:

Destroy Record

This endpoint should destroy the corresponding record (and any associated data, eg if you delete a merchant you should delete their items too). Since this is a permanent destruction of data, we do not return any response body of any kind, and should send a 204 HTTP status code.

Extension: when you delete an item, you will delete entries in the invoice_items table per the work above. This, however, might leave invoices in the database with no items at all, so you should find a way to clean those up, too.