Fix autovalue issue

This commit is contained in:
vjrj 2017-12-15 17:53:10 +01:00
parent 56a7468ae3
commit 6123977974
2 changed files with 5 additions and 3 deletions

View file

@ -1,7 +1,7 @@
/* eslint-disable prefer-arrow-callback */
import { Meteor } from 'meteor/meteor';
// import '../Users';
import '../Users';
Meteor.publish('users.editProfile', function usersProfile() {
return Meteor.users.find(this.userId, {

View file

@ -1,9 +1,11 @@
/* eslint-disable consistent-return */
/* eslint-disable prefer-arrow-callback */
export const defaultCreatedAt = {
type: Date,
// autoform: { type: 'hidden' },
autoValue: () => {
// Prefer normal function: https://github.com/aldeed/meteor-simple-schema/issues/562
autoValue: function autovalue() {
if (this.isInsert) {
return new Date();
}
@ -15,7 +17,7 @@ export const defaultCreatedAt = {
export const defaultUpdateAt = {
type: Date,
// autoform: { type: 'hidden' },
autoValue: () => {
autoValue: function autovalue() {
if (this.isUpdate || this.isInsert) {
return new Date();
}