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

userId is undefined in matb33:collection-hooks #77

Open
smeijer opened this issue Aug 10, 2020 · 1 comment
Open

userId is undefined in matb33:collection-hooks #77

smeijer opened this issue Aug 10, 2020 · 1 comment

Comments

@smeijer
Copy link
Contributor

smeijer commented Aug 10, 2020

Comments.before.insert(function (userId, doc) {
  const now = new Date();
  doc.createdBy = userId;
  doc.createdAt = now;
  doc.updatedBy = userId;
  doc.updatedAt = now;
})

When using cult-of-coders:apollo, userId is undefined in collection hooks. It does work when using swydo:ddp-apollo.

Is there a known work around?

@smeijer
Copy link
Contributor Author

smeijer commented Aug 10, 2020

Looks like we have the same issue for collection helpers (dburles/meteor-collection-helpers)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant