mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
ID should be optional
This commit is contained in:
parent
aa35d7f896
commit
19964efe1c
2 changed files with 6 additions and 2 deletions
|
@ -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']
|
||||
|
|
|
@ -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'],
|
||||
|
|
Loading…
Add table
Reference in a new issue