Skip to content

Commit

Permalink
fix: follow route to match spec
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Oct 8, 2020
1 parent b5bbcba commit db5c5b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/src/client/account/header.js
Expand Up @@ -116,7 +116,7 @@ define('forum/account/header', [

function toggleFollow(type) {
$.ajax({
url: config.relative_path + '/api/v1/users/' + ajaxify.data.uid + '/' + type,
url: config.relative_path + '/api/v1/users/' + ajaxify.data.uid + '/follow',
method: type === 'follow' ? 'post' : 'delete',
}).done(function () {
components.get('account/follow').toggleClass('hide', type === 'follow');
Expand Down
2 changes: 1 addition & 1 deletion src/routes/write/users.js
Expand Up @@ -30,7 +30,7 @@ function authenticatedRoutes() {
setupApiRoute(router, '/:uid/password', middleware, [...middlewares, middleware.checkRequired.bind(null, ['newPassword'])], 'put', controllers.write.users.changePassword);

setupApiRoute(router, '/:uid/follow', middleware, [...middlewares], 'post', controllers.write.users.follow);
setupApiRoute(router, '/:uid/unfollow', middleware, [...middlewares], 'delete', controllers.write.users.unfollow);
setupApiRoute(router, '/:uid/follow', middleware, [...middlewares], 'delete', controllers.write.users.unfollow);

// app.put('/:uid/follow', apiMiddleware.requireUser, function(req, res) {
// Users.follow(req.user.uid, req.params.uid, function(err) {
Expand Down

0 comments on commit db5c5b2

Please sign in to comment.