Skip to content

Commit

Permalink
opened methods as apis using meteor:rest module
Browse files Browse the repository at this point in the history
  • Loading branch information
shailee-m authored and brylie committed Sep 15, 2020
1 parent 3723126 commit a0c1a25
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ alanning:roles
jquery
lmieulet:meteor-coverage
matb33:collection-hooks
simple:rest
simple:json-routes
simple:rest-accounts-password
6 changes: 6 additions & 0 deletions app/.meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ [email protected]
[email protected]
[email protected]
[email protected]
simple:[email protected]
simple:[email protected]
simple:[email protected]
simple:[email protected]
simple:[email protected]
simple:[email protected]
simple:[email protected]
[email protected]
softwarerero:[email protected]
[email protected]
Expand Down
2 changes: 1 addition & 1 deletion app/server/methods/homes.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export default Meteor.methods({
let allowedGroups = [];

/* If user is admin */
const userId = Meteor.userId();
const userId = this.userId;
const userIsAdmin = Roles.userIsInRole(userId, 'admin');
if (!userIsAdmin) {
const permissions = Meteor.call(
Expand Down
8 changes: 8 additions & 0 deletions app/server/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,12 @@ Meteor.startup(function() {
});

Accounts.emailTemplates.from = process.env.FROM_EMAIL;

JsonRoutes.setResponseHeaders({
"Cache-Control": "no-store",
"Pragma": "no-cache",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,POST,HEAD,OPTIONS",
"Access-Control-Allow-Headers": "Authorization,Content-Type"
});
});

0 comments on commit a0c1a25

Please sign in to comment.