Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static create(req, res) {
- const {
- username,
- email,
- password
- } = req.body;
- models.User.create({
- username: username,
- email: email,
- password: password
- })
- .then(() => {
- res.status(201).json({
- success: true,
- message: "Pomyślnie założono konto."
- });
- })
- .catch(err => {
- res.status(err.errors[0].message.statusCode).json({
- success: false,
- message: err.errors[0].message.errorMessage,
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement