(app *App, w http.ResponseWriter, r *http.Request)
| 1225 | } |
| 1226 | |
| 1227 | func handleCollectionPostRedirect(app *App, w http.ResponseWriter, r *http.Request) error { |
| 1228 | vars := mux.Vars(r) |
| 1229 | slug := vars["slug"] |
| 1230 | |
| 1231 | cr := &collectionReq{} |
| 1232 | err := processCollectionRequest(cr, vars, w, r) |
| 1233 | if err != nil { |
| 1234 | return err |
| 1235 | } |
| 1236 | |
| 1237 | // Normalize the URL, redirecting user to consistent post URL |
| 1238 | loc := fmt.Sprintf("/%s", slug) |
| 1239 | if !app.cfg.App.SingleUser { |
| 1240 | loc = fmt.Sprintf("/%s/%s", cr.alias, slug) |
| 1241 | } |
| 1242 | return impart.HTTPError{http.StatusFound, loc} |
| 1243 | } |
| 1244 | |
| 1245 | func existingCollection(app *App, w http.ResponseWriter, r *http.Request) error { |
| 1246 | reqJSON := IsJSON(r) |
nothing calls this directly
no test coverage detected