v3
This commit is contained in:
parent
a005555840
commit
2d843e7870
@ -133,7 +133,7 @@ passport.use(
|
|||||||
let user = await authService.extraMethods.findUser({ id: result.id });
|
let user = await authService.extraMethods.findUser({ id: result.id });
|
||||||
if (user) {
|
if (user) {
|
||||||
user = user.toJSON();
|
user = user.toJSON();
|
||||||
const result = userService._updateLastLoginAndVersionUser(
|
userService._updateLastLoginAndVersionUser(
|
||||||
user.id,
|
user.id,
|
||||||
appVersion
|
appVersion
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,7 +22,7 @@ module.exports = function () {
|
|||||||
res.json({
|
res.json({
|
||||||
code: 200,
|
code: 200,
|
||||||
message: 'success',
|
message: 'success',
|
||||||
description: 'Welcome, this is the API for the application.'
|
description: 'Welcome, this is the API v3 for the application.'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ module.exports = function () {
|
|||||||
glob.sync("**/*.routes.js", globOptions)
|
glob.sync("**/*.routes.js", globOptions)
|
||||||
.forEach(function (file) {
|
.forEach(function (file) {
|
||||||
router.use('/v3', require(file));
|
router.use('/v3', require(file));
|
||||||
});
|
});
|
||||||
|
|
||||||
return router;
|
return router;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,7 +79,7 @@ async function loginWithPhone(req, res, next) {
|
|||||||
_user = _user.toJSON();
|
_user = _user.toJSON();
|
||||||
if (appVersion) {
|
if (appVersion) {
|
||||||
if (_user.app_version != appVersion) {
|
if (_user.app_version != appVersion) {
|
||||||
const result = userService._updateLastLoginAndVersionUser(
|
userService._updateLastLoginAndVersionUser(
|
||||||
_user.id,
|
_user.id,
|
||||||
appVersion
|
appVersion
|
||||||
);
|
);
|
||||||
@ -178,7 +178,7 @@ async function register(req, res, next) {
|
|||||||
name: req.body.name,
|
name: req.body.name,
|
||||||
surname: req.body.surname,
|
surname: req.body.surname,
|
||||||
entityId: req.body.entityid,
|
entityId: req.body.entityid,
|
||||||
accessibility: req.body.accesssibility,
|
accessibility: req.body.accessibility,
|
||||||
profile: req.body.profile,
|
profile: req.body.profile,
|
||||||
app_version: appVersion,
|
app_version: appVersion,
|
||||||
lastlogin: moment().utc(),
|
lastlogin: moment().utc(),
|
||||||
@ -202,7 +202,7 @@ async function register(req, res, next) {
|
|||||||
newUser = cleanAdminData(newUser);
|
newUser = cleanAdminData(newUser);
|
||||||
if (appVersion) {
|
if (appVersion) {
|
||||||
if (newUser.app_version != appVersion) {
|
if (newUser.app_version != appVersion) {
|
||||||
const result = userService._updateLastLoginAndVersionUser(
|
const result = await userService._updateLastLoginAndVersionUser(
|
||||||
newUser.id,
|
newUser.id,
|
||||||
appVersion
|
appVersion
|
||||||
);
|
);
|
||||||
|
|||||||
@ -59,6 +59,14 @@ const extraMethods = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_getInscriptionByEvent: (eventId) => {
|
||||||
|
return models.EventInscription.scope("defaultScope").findAll({
|
||||||
|
where: {
|
||||||
|
eventId: eventId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
_getInscriptionByEventAndValidated: (eventId, validated) => {
|
_getInscriptionByEventAndValidated: (eventId, validated) => {
|
||||||
return models.EventInscription.scope("defaultScope").findAll({
|
return models.EventInscription.scope("defaultScope").findAll({
|
||||||
where: {
|
where: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user