@ -112,3 +112,5 @@ DELETE /quotes/:id
```BASH
curl --request DELETE --header 'X-Quotes-API-Key: $API_KEY' 'https://ladylilia.com/quotes/api/quotes/666'
```
*Note: all subsequent quotes are reindexed*
@ -109,6 +109,10 @@ class QuoteResource(flask_restful.Resource):
flask_restful.abort(404, message='Quote {0} does not exist'.format(id))
db.session.delete(quote)
db.session.commit()
q = db.session.query(Quote).filter(Quote.id > id)
for quote in q.all():
quote.id -= 1
return None, 204