ID should be optional

This commit is contained in:
SachaG 2017-04-20 11:28:43 +09:00
parent aa35d7f896
commit 19964efe1c
2 changed files with 6 additions and 2 deletions

View file

@ -10,10 +10,12 @@ const schema = {
_id: {
type: String,
optional: true,
viewableBy: ['guests'],
},
createdAt: {
type: Date,
optional: true,
viewableBy: ['guests'],
autoValue: (documentOrModifier) => {
// if this is an insert, set createdAt to current timestamp
@ -22,6 +24,7 @@ const schema = {
},
userId: {
type: String,
optional: true,
viewableBy: ['guests'],
resolveAs: 'user: User', // resolve as "user" on the client
},
@ -32,7 +35,6 @@ const schema = {
label: 'Body',
placeholder: 'Add a comment…',
type: String,
optional: true,
viewableBy: ['guests'],
insertableBy: ['members'],
editableBy: ['members']

View file

@ -12,10 +12,12 @@ const schema = {
_id: {
type: String,
optional: true,
viewableBy: ['guests'],
},
createdAt: {
type: Date,
optional: true,
viewableBy: ['guests'],
autoValue: (documentOrModifier) => {
// if this is an insert, set createdAt to current timestamp
@ -24,6 +26,7 @@ const schema = {
},
userId: {
type: String,
optional: true,
viewableBy: ['guests'],
resolveAs: 'user: User', // resolve this field as "user" on the client
},
@ -33,7 +36,6 @@ const schema = {
imageUrl: {
label: 'Image URL',
type: String,
optional: true,
viewableBy: ['guests'],
insertableBy: ['members'],
editableBy: ['members'],