Skip to content

Commit 616bda0

Browse files
Merge pull request #369 from skryukov/protocol-errors-prop
[V2] Protocol: mark `errors` prop required
2 parents a4f2572 + 222a52d commit 616bda0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

resources/js/Pages/the-protocol.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function () {
5656
</head>
5757
<body>
5858
59-
<div id="app" data-page='{"component":"Event","props":{"event":{"id":80,"title":"Birthday party","start_date":"2019-06-02","description":"Come out and celebrate Jonathan&apos;s 36th birthday party!"}},"url":"/events/80","version":"c32b8e4965f418ad16eaebba1d4e960f"}'></div>
59+
<div id="app" data-page='{"component":"Event","props":{"errors":{},"event":{"id":80,"title":"Birthday party","start_date":"2019-06-02","description":"Come out and celebrate Jonathan&apos;s 36th birthday party!"}},"url":"/events/80","version":"c32b8e4965f418ad16eaebba1d4e960f"}'></div>
6060
6161
</body>
6262
</html>
@@ -111,6 +111,7 @@ export default function () {
111111
{
112112
"component": "Event",
113113
"props": {
114+
"errors": {},
114115
"event": {
115116
"id": 80,
116117
"title": "Birthday party",
@@ -137,7 +138,8 @@ export default function () {
137138
<Strong>component:</Strong> The name of the JavaScript page component.
138139
</Li>
139140
<Li>
140-
<Strong>props:</Strong> The page props (data).
141+
<Strong>props:</Strong> The page props. Contains all of the page data along with an <Code>errors</Code> object
142+
(defaults to <Code>{}</Code> if there are no errors).
141143
</Li>
142144
<Li>
143145
<Strong>url:</Strong> The page URL.
@@ -278,7 +280,8 @@ export default function () {
278280
"props": {
279281
"auth": {...}, // NOT included
280282
"categories": [...], // NOT included
281-
"events": [...] // included
283+
"events": [...], // included
284+
"errors": {} // always included
282285
},
283286
"url": "/events/80",
284287
"version": "c32b8e4965f418ad16eaebba1d4e960f"

0 commit comments

Comments
 (0)