create-guren-app 1.8.9 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -16,25 +16,21 @@ export interface PostResourceData extends Record<string, unknown> {
|
|
|
16
16
|
author?: PostAuthorSummary
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export class PostResource extends Resource<PostRecord | PostWithAuthor> {
|
|
19
|
+
export class PostResource extends Resource<PostRecord | PostWithAuthor, PostResourceData> {
|
|
20
20
|
toArray(): PostResourceData {
|
|
21
21
|
const post = this.resource
|
|
22
22
|
|
|
23
23
|
return {
|
|
24
|
-
id: post.id
|
|
25
|
-
title: post.title
|
|
26
|
-
excerpt: post.excerpt
|
|
27
|
-
body: post.body
|
|
28
|
-
authorId: post.authorId
|
|
29
|
-
createdAt: new Date(post.createdAt
|
|
24
|
+
id: post.id,
|
|
25
|
+
title: post.title,
|
|
26
|
+
excerpt: post.excerpt,
|
|
27
|
+
body: post.body,
|
|
28
|
+
authorId: post.authorId,
|
|
29
|
+
createdAt: new Date(post.createdAt).toISOString(),
|
|
30
30
|
author: this.whenLoaded('author', () => ({
|
|
31
31
|
id: (post as PostWithAuthor).author?.id,
|
|
32
32
|
name: (post as PostWithAuthor).author?.name,
|
|
33
33
|
})) as PostAuthorSummary | undefined,
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
override toJSON(): PostResourceData {
|
|
38
|
-
return super.toJSON() as PostResourceData
|
|
39
|
-
}
|
|
40
36
|
}
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"db:seed": "bunx guren db:seed"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@guren/cli": "^2.
|
|
23
|
-
"@guren/core": "^1.
|
|
22
|
+
"@guren/cli": "^2.10.0",
|
|
23
|
+
"@guren/core": "^1.9.0",
|
|
24
24
|
"@guren/inertia-client": "^1.1.2",
|
|
25
25
|
"@guren/orm": "^2.6.1",
|
|
26
26
|
"@inertiajs/react": "^3.6.1",
|