Skip to content

Commit

Permalink
refactor(editor): remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSputnik committed Nov 7, 2020
1 parent fda9add commit 4d6fa06
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/server/routes/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ router.post('/edit/handler', auth.isAuthenticatedForHandler, (req, res) => {
});

// Modify the user to match the updates from the form
const titleID = _.get(req.body, 'title', null) || null;
const titleID = _.get(req.body, 'title', null);
const modifiedEditor = await editor
.set('bio', req.body.bio)
.set('areaId', req.body.areaId)
Expand Down Expand Up @@ -482,15 +482,6 @@ router.post('/:id/achievements/', auth.isAuthenticated, (req, res) => {
throw new Error('Not authenticated');
}

// Presumably, this is testing that the provided editor ID is valid
// prior to attempting to update the ranks. Possibly not needed since
// the user must exist if authenticated?
await new Editor({id: userId})
.fetch({require: true});

// TODO: missing error handling for possible missing editor - carried
// over from old code.

const rankOnePromise = rankUpdate(orm, userId, req.body.rank1, 1);
const rankTwoPromise = rankUpdate(orm, userId, req.body.rank2, 2);
const rankThreePromise = rankUpdate(orm, userId, req.body.rank3, 3);
Expand Down

0 comments on commit 4d6fa06

Please sign in to comment.