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