func HandleUpdate(w http.ResponseWriter, r *http.Request) error {
	params, err := mux.Params(r)
	if err != nil {
		return server.InternalError(err)
	}
	redirect, err := redirects.Find(params.GetInt(redirects.KeyName))
	if err != nil {
		return server.NotFoundError(err)
	}
	err = session.CheckAuthenticity(w, r)
	if err != nil {
		return err
	}
	user := session.CurrentUser(w, r)
	err = can.Update(redirect, user)
	if err != nil {
		return server.NotAuthorizedError(err)
	}
	redirectParams := redirect.ValidateParams(params.Map(), redirects.AllowedParams())
	err = redirect.Update(redirectParams)
	if err != nil {
		return server.InternalError(err)
	}
	return server.Redirect(w, r, redirect.ShowURL())
}
HandleUpdate handles the POST of the form to update a redirect
package redirectactions
import (
	"net/http"
	"github.com/fragmenta/auth/can"
	"github.com/fragmenta/mux"
	"github.com/fragmenta/server"
	"github.com/fragmenta/view"
	"github.com/fragmenta/fragmenta-cms/src/lib/session"
	"github.com/fragmenta/fragmenta-cms/src/redirects"
)
func HandleUpdateShow(w http.ResponseWriter, r *http.Request) error {
	params, err := mux.Params(r)
	if err != nil {
		return server.InternalError(err)
	}
	redirect, err := redirects.Find(params.GetInt(redirects.KeyName))
	if err != nil {
		return server.NotFoundError(err)
	}
	user := session.CurrentUser(w, r)
	err = can.Update(redirect, user)
	if err != nil {
		return server.NotAuthorizedError(err)
	}
	view := view.NewRenderer(w, r)
	view.AddKey("currentUser", user)
	view.AddKey("redirect", redirect)
	return view.Render()
}