From 709fdc6ce0184034dfe2df7c413772c19a4455f0 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Wed, 15 Mar 2017 14:53:25 -0700 Subject: updating examples with deleteable --- examples/deleteable/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'examples/deleteable') diff --git a/examples/deleteable/README.md b/examples/deleteable/README.md index 06f4188..b990a82 100644 --- a/examples/deleteable/README.md +++ b/examples/deleteable/README.md @@ -1,12 +1,12 @@ -# Updateable +# Deleteable -This example shows how to enable outside clients to update content to your CMS. -All content submitted must be done through a POST request encoded as `multipart/form-data` -to the API endpoint `/api/content/update?type=&id=` +This example shows how to enable outside clients to delete content from your CMS. +All content deletes must be done through a POST request encoded as `multipart/form-data` +to the API endpoint `/api/content/delete?type=&id=` ## Song example Imagine an app that lets users add Spotify music to a global playlist, and you need them -to supply songs in the format: +to supply or remove songs which are in the format: ```go type Song struct { item.Item @@ -23,8 +23,8 @@ See the file `content/song.go` and read the comments to understand the various methods needed to satisfy required interfaces for this kind of activity. ### Overview -1. Implement `api.Updateable` with the `Update(http.ResponseWriter, *http.Request)` method to allow outside POST requests. -2. Consistent with the createable example, authentication can be validated in `BeforeAPIUpdate(http.ResponseWriter, *http.Request)` +1. Implement `api.Deleteable` with the `Delete(http.ResponseWriter, *http.Request)` method to allow outside POST requests. +2. Consistent with the createable example, authentication can be validated in `BeforeAPIDelete(http.ResponseWriter, *http.Request) error` There are various validation and request checks shown in this example as well. Please feel free to modify and submit a PR for updates or bug fixes! -- cgit v1.2.3