mirror of
https://github.com/gophish/gophish
synced 2024-11-15 00:37:14 +00:00
Fixed page editing. Fixes #44
This commit is contained in:
parent
014efb449e
commit
8141393480
2 changed files with 3 additions and 3 deletions
|
@ -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 a new issue