1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-30 10:01:54 +00:00

add tagging

This commit is contained in:
Rokt33r
2015-05-29 16:53:01 +09:00
parent 56175ecca5
commit e5b265e497
9 changed files with 72 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
angular.module('codexen.services')
.factory('Snippet', function ($http, $auth, apiUrl) {
var findByUser = function (user) {
var url = apiUrl + 'snippets'
var url = apiUrl + 'snippets/search'
return $http.get(url, {
params: {
@@ -11,13 +11,13 @@ angular.module('codexen.services')
}
var create = function (params) {
var url = apiUrl + 'snippets'
var url = apiUrl + 'snippets/create'
return $http.post(url, params)
}
var show = function (id) {
var url = apiUrl + 'snippets/' + id
var url = apiUrl + 'snippets/id/' + id
return $http.get(url)
}

16
src/services/tag.js Normal file
View File

@@ -0,0 +1,16 @@
angular.module('codexen.services')
.factory('Tag', function ($http, apiUrl) {
var findByName = function (tagName) {
var url = apiUrl + 'tags/search'
return $http.get(url, {
params: {
name: tagName
}
})
}
return {
findByName: findByName
}
})