mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Lots of changes and additions to the project. Still early, and not usable.
This commit is contained in:
parent
8636f8cf9b
commit
266dbd0856
41 changed files with 836 additions and 67 deletions
|
|
@ -11,10 +11,24 @@ Meteor.methods({
|
|||
console.log("User id for role: " + Meteor.userId() );
|
||||
let userId = Meteor.userId();
|
||||
Roles.addUsersToRoles(userId, role);
|
||||
Meteor.call('add.darkPref', false, function(err, result) {
|
||||
if (err) {
|
||||
console.log(" ERROR: can't set user dark mode preference: " + err);
|
||||
} else {
|
||||
console.log(" SUCCESSFULLY set user dark mode preference.");
|
||||
}
|
||||
});
|
||||
} else if (countOfUsers == 1) {
|
||||
console.log("Creating first system admin user: " + Meteor.userId() );
|
||||
let userId = Meteor.userId();
|
||||
Roles.addUsersToRoles(userId, "systemadmin");
|
||||
Meteor.call('add.darkPref', false, function(err, result) {
|
||||
if (err) {
|
||||
console.log(" ERROR: can't set user dark mode preference: " + err);
|
||||
} else {
|
||||
console.log(" SUCCESSFULLY set user dark mode preference.");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
@ -1,4 +1,9 @@
|
|||
import { SysConfig } from '../imports/api/systemConfig.js';
|
||||
import { Stores } from '../imports/api/stores.js';
|
||||
import { UserConfigOptions } from '../imports/api/userConfigOptions.js';
|
||||
import { Products } from '../imports/api/products.js';
|
||||
import { Categories } from '../imports/api/category.js';
|
||||
import { Locations } from '../imports/api/location.js';
|
||||
|
||||
Meteor.publish("SystemConfig", function() {
|
||||
try {
|
||||
|
|
@ -7,3 +12,39 @@ Meteor.publish("SystemConfig", function() {
|
|||
console.log(" ERROR pulling system config data: " + error);
|
||||
}
|
||||
});
|
||||
|
||||
Meteor.publish('userList', function() {
|
||||
return Meteor.users.find({});
|
||||
});
|
||||
|
||||
Meteor.publish("storeInfo", function() {
|
||||
try {
|
||||
return Stores.find({ owner: this.userId });
|
||||
} catch (error) {
|
||||
console.log(" ERROR pulling store data: " + error);
|
||||
}
|
||||
});
|
||||
|
||||
Meteor.publish("myProducts", function() {
|
||||
try {
|
||||
return Products.find({ prodOwner: this.userId });
|
||||
} catch (error) {
|
||||
console.log(" ERROR pulling product data: " + error);
|
||||
}
|
||||
});
|
||||
|
||||
Meteor.publish("myCategories", function() {
|
||||
try {
|
||||
return Categories.find({ categoryOwner: this.userId });
|
||||
} catch (error) {
|
||||
console.log(" ERROR pulling category data: " + error);
|
||||
}
|
||||
});
|
||||
|
||||
Meteor.publish("myLocations", function() {
|
||||
try {
|
||||
return Locations.find({ owner: this.userId });
|
||||
} catch (error) {
|
||||
console.log(" ERROR pulling location data: " + error);
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue