From f255179c39211a159932ca3f8a2738b3c943f09d Mon Sep 17 00:00:00 2001
From: Aaron Parecki <aaron@parecki.com>
Date: Fri, 20 May 2016 08:09:32 -0700
Subject: don't need to json.parse when the content type header is right

---
 views/event.php         | 3 +--
 views/new-bookmark.php  | 4 +---
 views/new-favorite.php  | 4 +---
 views/new-itinerary.php | 3 +--
 views/new-repost.php    | 3 +--
 5 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/views/event.php b/views/event.php
index ff11678..1a11681 100644
--- a/views/event.php
+++ b/views/event.php
@@ -81,8 +81,7 @@
         "type": "h-event",
         "properties": properties
       })
-    }, function(data){
-      var response = JSON.parse(data);
+    }, function(response){
 
       if(response.location != false) {
         $("#test_success").removeClass('hidden');
diff --git a/views/new-bookmark.php b/views/new-bookmark.php
index 6ab0606..7f381ab 100644
--- a/views/new-bookmark.php
+++ b/views/new-bookmark.php
@@ -80,9 +80,7 @@ $(function(){
       content: $("#note_content").val(),
       category: csv_to_array($("#note_category").val()),
       'syndicate-to': syndications
-    }, function(data){
-      var response = JSON.parse(data);
-
+    }, function(response){
       if(response.location != false) {
 
         $("#test_success").removeClass('hidden');
diff --git a/views/new-favorite.php b/views/new-favorite.php
index 5ec4498..3231ab2 100644
--- a/views/new-favorite.php
+++ b/views/new-favorite.php
@@ -46,9 +46,7 @@ $(function(){
 
     $.post("/favorite", {
       url: $("#note_url").val()
-    }, function(data){
-      var response = JSON.parse(data);
-
+    }, function(response){
       if(response.location != false) {
 
         if(autosubmit) {
diff --git a/views/new-itinerary.php b/views/new-itinerary.php
index 7020e10..4f07476 100644
--- a/views/new-itinerary.php
+++ b/views/new-itinerary.php
@@ -185,8 +185,7 @@ $(function(){
           "category": category
         }
       })
-    }, function(data){
-      var response = JSON.parse(data);
+    }, function(response){
 
       if(response.location != false) {
         $("#test_success").removeClass('hidden');
diff --git a/views/new-repost.php b/views/new-repost.php
index a60b8ea..354083b 100644
--- a/views/new-repost.php
+++ b/views/new-repost.php
@@ -30,8 +30,7 @@ $(function(){
 
     $.post("/repost", {
       url: $("#note_url").val()
-    }, function(data){
-      var response = JSON.parse(data);
+    }, function(response){
 
       if(response.location != false) {
 
-- 
cgit v1.2.3