Skip to content

Commit

Permalink
chore(issues): clean up and correct any bad refs for issue endpoints,…
Browse files Browse the repository at this point in the history
… add comments to document endpoints
  • Loading branch information
levbrie committed Mar 15, 2015
1 parent e3d0219 commit ef4461f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
6 changes: 2 additions & 4 deletions public/app/issue/Issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
var endpoint = this.endpointWithId() + '/links/' + link._id;
return $http.delete(endpoint).then(getDeleteData);
},
deleteFounder: function(founder) {
var endpoint = this.endpointWithId() + '/founders/' + founder._id;
deleteIssue: function(issue) {
var endpoint = this.endpointWithId() + '/issues/' + issue._id;
return $http.delete(endpoint).then(getDeleteData);
},
endpointWithId: function() {
Expand All @@ -42,8 +42,6 @@
return dataToReturn;
}



return Issue;
});
}());
3 changes: 1 addition & 2 deletions public/app/issue/issue-list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<div layout="column"
hotkey="{right: vm.reselect, space: vm.reselect}">
<div layout="column">

<section layout="row" flex>
<md-toolbar md-scroll-shrink>
Expand Down
9 changes: 9 additions & 0 deletions server/api/issues/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
(function () {
'use strict';

/*
* ENDPOINTS:
* GET /api/issues -> index
* POST /api/issues -> create
* GET /api/issues/:id -> show
* PUT /api/issues/:id -> update
* DELETE /api/issues/:id -> destroy
*/

var express = require('express'),
router = express.Router(),
controller = require('./issues.controller');
Expand Down
5 changes: 3 additions & 2 deletions server/api/issues/issue.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
qs = require('querystring'),
ObjectId = mongoose.Schema.Types.ObjectId,
ts = require('../../db/plugins/timestamps'),
_ = require('lodash');
_ = require('lodash'),
STATES = ['open', 'close'];

var Issue;
var STATES = ['open', 'close'];

var IssueSchema = mongoose.Schema({
url: String,
labels: [],
Expand Down
3 changes: 0 additions & 3 deletions server/config/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@
app.use('/api/issues', require('../api/issues'));
app.use('/auth', require('../auth'));



app.route('/partials/*')
.get(clientViews.viewPartials);
// i think the below is the express 4 way to do it

// All undefined asset or api routes should return a 404
app.route('/:url(api|auth|components|app|bower_components|assets)/*')
Expand Down

0 comments on commit ef4461f

Please sign in to comment.