Example #1
0
func (this *TopicController) Delete() {
	if !checkAccount(this.Ctx) {
		this.Redirect("/login", 302)
		return
	}

	err := models.DeleteTopic(this.Ctx.Input.Param("0"))
	if err != nil {
		beego.Error(err)
	}
	this.Redirect("/", 302)
}
Example #2
0
func (this *TopicController) Del() {
	if !checkAccount(this.Ctx) {
		beego.Error("delete topic")
		this.Redirect("/login", 302)
		return
	}
	id := this.Input().Get("id")
	err := models.DeleteTopic(id)
	if err != nil {
		beego.Error(err)
	}
	this.Redirect("/topic", 302)
}