Browse Source

Level 3.10.1 typical hand-built crud.

Frederic G. MARAND 6 years ago
parent
commit
cfb8548cac
1 changed files with 18 additions and 3 deletions
  1. 18 3
      js/services/note.js

+ 18 - 3
js/services/note.js

@@ -20,12 +20,27 @@ angular.module("noteWrangler")
         });
       },
 
-      create: function (note) {
+      find: function (id) {
         return $http({
-          method: "PUT",
+          method: "GET",
+          url: "/notes/" + id.toString(),
+        });
+      },
+
+      create: function (noteObj) {
+        return $http({
+          method: "POST",
           url: "/notes",
-          data: note,
+          data: noteObj,
         });
       },
+
+      update: function (nodeObj) {
+        return $http({
+          method: "PUT",
+          url: "/notes",
+          data: nodeObj,
+        })
+      },
     }
   }]);