how can i fix problem to add user after login
//this my index.controller
(function () {
'use strict';
angular
.module('app')
.controller('AddUsers.IndexController', Controller);
function Controller($window, UserService, FlashService) {
var vm=this;
vm.user=null;
vm.addUser=addUser;
function addUser() {
UserService.Create({
error: response.body,
firstName: req.body.firstName,
lastName: req.body.lastName,
gender: req.body.gender,
address: req.body.address,
phone: req.body.phone,
level:req.body.level,
username: req.body.username
})
.then(function () {
FlashService.Success('New user Created!');
})
.catch(function (error) {
FlashService.Error(error);
});
}
}
})();
//this my api users.service
router.post('/', CreateUser);
function CreateUser(req, res) {
userService.create(req.body)
.then(function () {
res.sendStatus(200);
})
.catch(function (err) {
res.status(400).send(err);
});
}
please fix this where can i put the user.param..i tri to use vm.user like an update script but that failed.. :)
but i jus want the say you are THE BEST and be a my inspirator.. ;)
how can i fix problem to add user after login
//this my index.controller
(function () {
'use strict';
})();
//this my api users.service
router.post('/', CreateUser);
function CreateUser(req, res) {
userService.create(req.body)
.then(function () {
res.sendStatus(200);
})
.catch(function (err) {
res.status(400).send(err);
});
}
please fix this where can i put the user.param..i tri to use vm.user like an update script but that failed.. :)
but i jus want the say you are THE BEST and be a my inspirator.. ;)