-
Notifications
You must be signed in to change notification settings - Fork 110
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
f133384
commit 830f28e
Showing
71 changed files
with
248 additions
and
251 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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,20 @@ | ||
import { validate } from '@redwoodjs/api' | ||
|
||
import { db } from 'src/lib/db' | ||
|
||
export const contacts = () => { | ||
return db.contact.findMany() | ||
} | ||
|
||
export const contact = ({ id }) => { | ||
return db.contact.findUnique({ | ||
where: { id }, | ||
}) | ||
} | ||
|
||
export const createContact = ({ input }) => { | ||
validate(input.email, 'email', { email: true }) | ||
return db.contact.create({ | ||
data: input, | ||
}) | ||
} |
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
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
This file was deleted.
Oops, something went wrong.
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,30 @@ | ||
import { db } from 'src/lib/db' | ||
|
||
export const posts = () => { | ||
return db.post.findMany() | ||
} | ||
|
||
export const post = ({ id }) => { | ||
return db.post.findUnique({ | ||
where: { id }, | ||
}) | ||
} | ||
|
||
export const createPost = ({ input }) => { | ||
return db.post.create({ | ||
data: input, | ||
}) | ||
} | ||
|
||
export const updatePost = ({ id, input }) => { | ||
return db.post.update({ | ||
data: input, | ||
where: { id }, | ||
}) | ||
} | ||
|
||
export const deletePost = ({ id }) => { | ||
return db.post.delete({ | ||
where: { id }, | ||
}) | ||
} |
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 const standard = defineScenario({ | ||
post: { | ||
one: { data: { title: 'String', body: 'String' } }, | ||
two: { data: { title: 'String', body: 'String' } }, | ||
}, | ||
}) |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
9 changes: 2 additions & 7 deletions
9
web/src/components/Article/Article.tsx → web/src/components/Article/Article.js
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
File renamed without changes.
File renamed without changes.
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,22 @@ | ||
import Article from 'src/components/Article' | ||
|
||
export const QUERY = gql` | ||
query FindArticleQuery($id: Int!) { | ||
article: post(id: $id) { | ||
id | ||
title | ||
body | ||
createdAt | ||
} | ||
} | ||
` | ||
|
||
export const Loading = () => <div>Loading...</div> | ||
|
||
export const Empty = () => <div>Empty</div> | ||
|
||
export const Failure = ({ error }) => <div>Error: {error.message}</div> | ||
|
||
export const Success = ({ article }) => { | ||
return <Article article={article} /> | ||
} |
2 changes: 1 addition & 1 deletion
2
...omponents/ArticleCell/ArticleCell.mock.ts → ...omponents/ArticleCell/ArticleCell.mock.js
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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.