Skip to content

Commit 0a938cd

Browse files
committed
chore: add console.log to check cannot read properties
1 parent 9a5f81b commit 0a938cd

File tree

1 file changed

+8
-0
lines changed
  • apps/server/src/services/PostApiService

1 file changed

+8
-0
lines changed

apps/server/src/services/PostApiService/index.mts

+8
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ export class PostApiService implements Service {
5757
ip,
5858
})
5959

60+
if (!post) {
61+
throw new NotFoundError('Not found post when create post')
62+
}
63+
6064
if (series_id && !data.is_temp) {
6165
await this.seriesService.appendToSeries(series_id, post.id)
6266
}
@@ -75,6 +79,10 @@ export class PostApiService implements Service {
7579
ip,
7680
})
7781

82+
if (!post) {
83+
throw new NotFoundError('Not found post when edit post')
84+
}
85+
7886
const prevSeriesPost = await this.db.seriesPost.findFirst({
7987
where: {
8088
fk_post_id: post.id,

0 commit comments

Comments
 (0)