Skip to content
This repository has been archived by the owner on Aug 28, 2020. It is now read-only.

Commit

Permalink
Fix PUT API
Browse files Browse the repository at this point in the history
  • Loading branch information
ukatama committed Apr 4, 2016
1 parent be06a96 commit d26747f
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions src/server/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,7 @@ export const router = (app) => {
.where('id', req.params.id)
.update('data', JSON.stringify(data))
)
.then(
() => knex('characters')
.whereNull('deleted')
.where('id', req.params.id)
.first()
)
.then(() => getCharacter(req.params.id))
.then((character) => res.send(character))
.catch(next)
);
Expand All @@ -168,12 +163,7 @@ export const router = (app) => {
.where('id', req.params.id)
.update('data', JSON.stringify(data))
)
.then(
() => knex('characters')
.whereNull('deleted')
.where('id', req.params.id)
.first()
)
.then(() => getCharacter(req.params.id))
.then((character) => res.send(character))
.catch(next)
);
Expand All @@ -195,12 +185,7 @@ export const router = (app) => {
.where('id', params.id)
.update('data', JSON.stringify(data))
)
.then(
() => knex('characters')
.whereNull('deleted')
.where('id', params.id)
.first()
)
.then(() => getCharacter(params.id))
.then((character) => res.send(character))
.catch(next)
);
Expand All @@ -222,12 +207,7 @@ export const router = (app) => {
.where('id', params.id)
.update('data', JSON.stringify(data))
)
.then(
() => knex('characters')
.whereNull('deleted')
.where('id', params.id)
.first()
)
.then(() => getCharacter(params.id))
.then((character) => res.send(character))
.catch(next)
);
Expand Down

0 comments on commit d26747f

Please sign in to comment.