create-fate 1.14.0 → 1.15.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
|
@@ -152,15 +152,6 @@ export const fateServer = createFateServer({
|
|
|
152
152
|
throw new Error('Comment not found.');
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
const liveComment = await source.resolveById({
|
|
156
|
-
ctx,
|
|
157
|
-
id: commentId,
|
|
158
|
-
input: {
|
|
159
|
-
select: ['author.id', 'author.name', 'author.username', 'content', 'id'],
|
|
160
|
-
},
|
|
161
|
-
view: commentDataView,
|
|
162
|
-
});
|
|
163
|
-
|
|
164
155
|
if (hasNestedSelection(select, 'post')) {
|
|
165
156
|
created.post = (await source.resolveById<PostItem>({
|
|
166
157
|
ctx,
|
|
@@ -173,9 +164,7 @@ export const fateServer = createFateServer({
|
|
|
173
164
|
})) as PostItem | null;
|
|
174
165
|
}
|
|
175
166
|
|
|
176
|
-
live
|
|
177
|
-
.connection('Post.comments', { id: input.postId })
|
|
178
|
-
.appendNode('Comment', commentId, { node: liveComment ?? created });
|
|
167
|
+
live.connection('Post.comments', { id: input.postId }).appendNode('Comment', commentId);
|
|
179
168
|
live.update('Post', input.postId, { changed: ['commentCount', 'comments'] });
|
|
180
169
|
|
|
181
170
|
return created as CommentItem & { post?: { commentCount: number } };
|
|
@@ -317,7 +306,7 @@ export const fateServer = createFateServer({
|
|
|
317
306
|
throw new Error('Post not found.');
|
|
318
307
|
}
|
|
319
308
|
|
|
320
|
-
live.update('Post', input.id, { changed: ['likes']
|
|
309
|
+
live.update('Post', input.id, { changed: ['likes'] });
|
|
321
310
|
|
|
322
311
|
return post as Post;
|
|
323
312
|
},
|
|
@@ -344,7 +333,7 @@ export const fateServer = createFateServer({
|
|
|
344
333
|
throw new Error('Post not found.');
|
|
345
334
|
}
|
|
346
335
|
|
|
347
|
-
live.update('Post', input.id, { changed: ['likes']
|
|
336
|
+
live.update('Post', input.id, { changed: ['likes'] });
|
|
348
337
|
|
|
349
338
|
return post as Post;
|
|
350
339
|
},
|