-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pagination): Implementating pagination for articles
- Loading branch information
Elie Mugenzi
authored and
Elie Mugenzi
committed
Jun 19, 2019
1 parent
3473a82
commit 37ade04
Showing
14 changed files
with
440 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import models from '../sequelize/models'; | ||
|
||
const checkEmail = { | ||
async userExist(req, res, next) { | ||
const { email } = req.body; | ||
await models.User.findAll({ | ||
where: { | ||
}, | ||
}).then((data) => { | ||
if (data.length > 0) { | ||
return res.status(400).json({ | ||
status: 400, | ||
message: 'This email is already in use', | ||
}); | ||
} | ||
}); | ||
|
||
next(); | ||
}, | ||
}; | ||
|
||
export default checkEmail; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import models from '../sequelize/models'; | ||
|
||
const usernameAvailability = { | ||
async usernameExist(req, res, next) { | ||
const { username } = req.body; | ||
await models.User.findAll({ | ||
where: { | ||
username | ||
}, | ||
}).then((data) => { | ||
if (data.length > 0) { | ||
return res.status(400).json({ | ||
status: 400, | ||
message: 'This username is not available, Please choose another one!', | ||
}); | ||
} | ||
}); | ||
|
||
next(); | ||
}, | ||
}; | ||
|
||
export default usernameAvailability; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.