Fix autovalue issue
This commit is contained in:
parent
56a7468ae3
commit
6123977974
2 changed files with 5 additions and 3 deletions
|
|
@ -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, {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue