mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Updating framework to meteor 3 and later
This commit is contained in:
parent
717994508a
commit
cca29bc591
58 changed files with 2332 additions and 1611 deletions
|
|
@ -22,22 +22,34 @@ Meteor.methods({
|
|||
|
||||
// first let's find out if there's an entry for this user and view, and if so
|
||||
// we'll just edit that entry with updated information
|
||||
let userListInfo = UserLast.findOne({ userId: this.userId, view: view });
|
||||
if (typeof userListInfo != 'undefined' && userListInfo != "" && userListInfo != null) {
|
||||
// entry exists, call the edit function instead
|
||||
Meteor.call('edit.userLast', view, viewId, function(err, result) {
|
||||
if (err) {
|
||||
console.log(" ERROR moving user to edit for last view: " + err);
|
||||
const getUserLast = async() => {
|
||||
let userListInfo = await UserLast.findOneAsync({ userId: this.userId, view: view });
|
||||
if (!userListInfo) {
|
||||
console.log("Adding new user last item.");
|
||||
return UserLast.insertAsync({
|
||||
userId: this.userId,
|
||||
view: view,
|
||||
viewId: viewId,
|
||||
dateAdded: Date(),
|
||||
});
|
||||
} else {
|
||||
console.log("Editing existing user last itme.");
|
||||
// entry exists, call the edit function instead
|
||||
let result = await Meteor.callAsync('edit.userLast', view, viewId);
|
||||
if (!result) {
|
||||
try {
|
||||
console.log("Issue editing existing entry in userLast. Check the logs.");
|
||||
} catch(error) {
|
||||
console.log(" ERROR adding userLast item: " + error);
|
||||
console.log(error.message);
|
||||
console.log(error.stack);
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return UserLast.insert({
|
||||
userId: this.userId,
|
||||
view: view,
|
||||
viewId: viewId,
|
||||
dateAdded: Date(),
|
||||
});
|
||||
}
|
||||
}
|
||||
return getUserLast();
|
||||
},
|
||||
'edit.userLast' (view, viewId) {
|
||||
check(view, String);
|
||||
|
|
@ -47,7 +59,8 @@ Meteor.methods({
|
|||
throw new Meteor.Error('Not able to change user view last setting. Make sure you are logged in with valid system administrator credentials.');
|
||||
}
|
||||
|
||||
return UserLast.update({ view: view, userId: this.userId }, {
|
||||
console.log("Edit in progress.");
|
||||
return UserLast.updateAsync({ view: view, userId: this.userId }, {
|
||||
$set: {
|
||||
viewId: viewId,
|
||||
dateLastUpdate: Date(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue