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.
|
||||
// Per the PUT Method RFC, it presumes all data for a page is provided.
|
||||
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 {
|
||||
Logger.Println(err)
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@ function save(idx){
|
|||
page.name = $("#name").val()
|
||||
page.html = CKEDITOR.instances["html_editor"].getData();
|
||||
if (idx != -1){
|
||||
page.id = page[idx].id
|
||||
api.landing_pageId.put(page)
|
||||
page.id = pages[idx].id
|
||||
api.pageId.put(page)
|
||||
.success(function(data){
|
||||
successFlash("Page edited successfully!")
|
||||
load()
|
||||
|
|
Loading…
Reference in New Issue