From 81413934809cf3a4399cddc2674d1ae41ab03212 Mon Sep 17 00:00:00 2001 From: Jordan Wright Date: Fri, 23 Oct 2015 18:35:42 -0500 Subject: [PATCH] Fixed page editing. Fixes #44 --- models/page.go | 2 +- static/js/app/landing_pages.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/models/page.go b/models/page.go index a94c463f..23af64c3 100644 --- a/models/page.go +++ b/models/page.go @@ -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) } diff --git a/static/js/app/landing_pages.js b/static/js/app/landing_pages.js index 48955e3e..dd7b30cb 100644 --- a/static/js/app/landing_pages.js +++ b/static/js/app/landing_pages.js @@ -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()