Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature mongo async #35

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1dbc376
chore(step02): added mongo async API
Grubba27 Sep 5, 2022
01cc2b6
chore(step03): added mongo async API
Grubba27 Sep 5, 2022
01f8460
chore(step03): added mongo async API in main.js
Grubba27 Sep 5, 2022
0ba6aa8
chore(step04): added mongo async API in App.js
Grubba27 Sep 5, 2022
f40bea5
chore(step04): added mongo async API in Task.js
Grubba27 Sep 5, 2022
73c81ae
chore(step04): added mongo async API in main.js
Grubba27 Sep 5, 2022
637eb8b
chore(step05): added mongo async API in App.js
Grubba27 Sep 5, 2022
66616b8
chore(step05): added mongo async API in Task.js
Grubba27 Sep 5, 2022
4fdbcd0
chore(step05): added mongo async API in server.js
Grubba27 Sep 5, 2022
20ea905
chore(step06): added mongo async API in App.js
Grubba27 Sep 5, 2022
1fa20b6
chore(step06): added mongo async API in Task.js
Grubba27 Sep 5, 2022
96d1637
chore(step06): added mongo async API in main.js
Grubba27 Sep 5, 2022
1ccfcc0
chore(step07): added mongo async API in App.js
Grubba27 Sep 5, 2022
5011e0b
chore(step07): added mongo async API in Task.js
Grubba27 Sep 5, 2022
f7d2943
chore(step07): added mongo async API in main.js
Grubba27 Sep 5, 2022
ee5df0c
chore(step08): added mongo async API in taskMethods.js
Grubba27 Sep 5, 2022
bf3c320
chore(step08): added mongo async API in app.js
Grubba27 Sep 5, 2022
47e84c2
chore(step08): added mongo async API in Main.js
Grubba27 Sep 5, 2022
53f696e
chore(step09): added mongo async API in taskMethiods.js
Grubba27 Sep 5, 2022
8687992
chore(step09): added mongo async API in App.js
Grubba27 Sep 5, 2022
b9346ea
chore(step09): added mongo async API in main.js
Grubba27 Sep 5, 2022
1bb2e3b
chore(step10): added mongo async API in taskMethods.js
Grubba27 Sep 5, 2022
f356dbe
chore(step10): added mongo async API in App.js
Grubba27 Sep 5, 2022
58b0569
chore(step10): added mongo async API in main.js
Grubba27 Sep 5, 2022
fa8a37a
chore(step11): added mongo async API in step 11
Grubba27 Sep 5, 2022
fa26dd9
chore(step12): added mongo async API in step 12
Grubba27 Sep 5, 2022
708cfcf
chore(step13): added mongo async API in step 13
Grubba27 Sep 5, 2022
5f7901b
docs: updated step 2 with new Mongo async API
Grubba27 Sep 5, 2022
c334fb6
docs: updated step 3 with new Mongo async API
Grubba27 Sep 5, 2022
59c4e6f
docs: updated step 4 with new Mongo async API
Grubba27 Sep 5, 2022
8db739c
docs: updated step 6 with new Mongo async API
Grubba27 Sep 5, 2022
0380903
docs: updated step 7 with new Mongo async API
Grubba27 Sep 5, 2022
091e428
docs: updated step 8 with new Mongo async API
Grubba27 Sep 5, 2022
df88896
docs: updated step 9 with new Mongo async API
Grubba27 Sep 5, 2022
67898f1
docs: updated step 11 with new Mongo async API
Grubba27 Sep 5, 2022
7f4911e
chore: update changelog with mongo async api
Grubba27 Sep 5, 2022
990fa0e
chore: added missing await token for main.js
Grubba27 Sep 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: updated step 9 with new Mongo async API
  • Loading branch information
Grubba27 committed Sep 5, 2022
commit df8889643256f8e0ad328ca9a28ad27e82393af6
76 changes: 38 additions & 38 deletions tutorial/simple-todos/09-publications.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,44 +137,44 @@ Only the owner of a task should be able to change certain things. You should cha
`imports/api/tasksMethods.js`

```js
..
'tasks.remove'(taskId) {
check(taskId, String);

if (!this.userId) {
throw new Meteor.Error('Not authorized.');
}

const task = TasksCollection.findOne({ _id: taskId, userId: this.userId });

if (!task) {
throw new Meteor.Error('Access denied.');
}

TasksCollection.remove(taskId);
},

'tasks.setIsChecked'(taskId, isChecked) {
check(taskId, String);
check(isChecked, Boolean);

if (!this.userId) {
throw new Meteor.Error('Not authorized.');
}

const task = TasksCollection.findOne({ _id: taskId, userId: this.userId });

if (!task) {
throw new Meteor.Error('Access denied.');
}

TasksCollection.update(taskId, {
$set: {
isChecked,
},
});
},
..
...
async 'tasks.remove'(taskId) {
check(taskId, String);
if (!this.userId) {
throw new Meteor.Error('Not authorized.');
}
const task = await TasksCollection.findOneAsync({ _id: taskId, userId: this.userId });
if (!task) {
throw new Meteor.Error('Access denied.');
}
await TasksCollection.removeAsync(taskId);
},

async 'tasks.setIsChecked'(taskId, isChecked) {
check(taskId, String);
check(isChecked, Boolean);
if (!this.userId) {
throw new Meteor.Error('Not authorized.');
}
const task = await TasksCollection.findOneAsync({ _id: taskId, userId: this.userId });
if (!task) {
throw new Meteor.Error('Access denied.');
}
await TasksCollection.updateAsync(taskId, {
$set: {
isChecked,
},
});
},
...
```

Why is this important if we are not returning tasks from other users in the client?
Expand Down