mirror of https://github.com/gophish/gophish
Fixed page editing. Fixes #44
parent
014efb449e
commit
8141393480
|
@ -74,7 +74,7 @@ func PostPage(p *Page) error {
|
||||||
// PutPage edits an existing Page in the database.
|
// PutPage edits an existing Page in the database.
|
||||||
// Per the PUT Method RFC, it presumes all data for a page is provided.
|
// Per the PUT Method RFC, it presumes all data for a page is provided.
|
||||||
func PutPage(p *Page) error {
|
func PutPage(p *Page) error {
|
||||||
err := db.Debug().Where("id=?", p.Id).Save(p).Error
|
err := db.Where("id=?", p.Id).Save(p).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Logger.Println(err)
|
Logger.Println(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,8 @@ function save(idx){
|
||||||
page.name = $("#name").val()
|
page.name = $("#name").val()
|
||||||
page.html = CKEDITOR.instances["html_editor"].getData();
|
page.html = CKEDITOR.instances["html_editor"].getData();
|
||||||
if (idx != -1){
|
if (idx != -1){
|
||||||
page.id = page[idx].id
|
page.id = pages[idx].id
|
||||||
api.landing_pageId.put(page)
|
api.pageId.put(page)
|
||||||
.success(function(data){
|
.success(function(data){
|
||||||
successFlash("Page edited successfully!")
|
successFlash("Page edited successfully!")
|
||||||
load()
|
load()
|
||||||
|
|
Loading…
Reference in New Issue