-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8dcd92f
commit f6ca471
Showing
6 changed files
with
123 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export default { | ||
name: "comment", | ||
title: "Comment", | ||
type: "document", | ||
fields: [ | ||
{ | ||
name: "postedBy", | ||
title: "PostedBy", | ||
type: "postedBy", | ||
}, | ||
{ | ||
name: "comment", | ||
title: "Comment", | ||
type: "string", | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
export default { | ||
name: "pin", | ||
title: "Pin", | ||
type: "document", | ||
fields: [ | ||
{ | ||
name: "title", | ||
title: "Title", | ||
type: "string", | ||
}, | ||
{ | ||
name: "about", | ||
title: "About", | ||
type: "string", | ||
}, | ||
{ | ||
name: "destination", | ||
title: "Destination", | ||
type: "url", | ||
}, | ||
{ | ||
name: "category", | ||
title: "Category", | ||
type: "string", | ||
}, | ||
{ | ||
name: "image", | ||
title: "Image", | ||
type: "image", | ||
options: { | ||
hotspot: true, | ||
}, | ||
}, | ||
{ | ||
name: "userId", | ||
title: "UserID", | ||
type: "string", | ||
}, | ||
{ | ||
name: "postedBy", | ||
title: "PostedBy", | ||
type: "postedBy", | ||
}, | ||
{ | ||
name: "save", | ||
title: "Save", | ||
type: "array", | ||
of: [{ type: "save" }], | ||
}, | ||
{ | ||
name: "comments", | ||
title: "Comments", | ||
type: "array", | ||
of: [{ type: "comment" }], | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
name: "postedBy", | ||
title: "PostedBy", | ||
type: "reference", | ||
to: [{ type: "user" }], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export default { | ||
name: "save", | ||
title: "Save", | ||
type: "document", | ||
fields: [ | ||
{ | ||
name: "postedBy", | ||
title: "PostedBy", | ||
type: "postedBy", | ||
}, | ||
{ | ||
name: "userId", | ||
title: "UserId", | ||
type: "string", | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
// First, we must import the schema creator | ||
import createSchema from 'part:@sanity/base/schema-creator' | ||
import createSchema from "part:@sanity/base/schema-creator" | ||
|
||
// Then import schema types from any plugins that might expose them | ||
import schemaTypes from 'all:part:@sanity/base/schema-type' | ||
import schemaTypes from "all:part:@sanity/base/schema-type" | ||
import user from "./user" | ||
import pin from "./pin" | ||
import comment from "./comment" | ||
import postedBy from "./postedBy" | ||
import save from "./save" | ||
|
||
// Then we give our schema to the builder and provide the result to Sanity | ||
export default createSchema({ | ||
// We name our schema | ||
name: 'default', | ||
name: "default", | ||
// Then proceed to concatenate our document type | ||
// to the ones provided by any plugins that are installed | ||
types: schemaTypes.concat([ | ||
/* Your types here! */ | ||
]), | ||
types: schemaTypes.concat([user, pin, comment, postedBy, save]), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export default { | ||
name: "user", | ||
title: "User", | ||
type: "document", | ||
fields: [ | ||
{ | ||
name: "username", | ||
title: "Username", | ||
type: "string", | ||
}, | ||
{ | ||
name: "image", | ||
title: "Image", | ||
type: "string", | ||
}, | ||
], | ||
} |