Skip to content

Commit 8d17979

Browse files
committed
fix: too long urlslug
1 parent 13700a4 commit 8d17979

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export class PostApiService implements Service {
121121
})
122122
} catch (error) {
123123
console.error('Prisma update error:', error)
124-
throw new Error('Failed to update post')
124+
throw error
125125
}
126126

127127
try {
@@ -240,7 +240,7 @@ export class PostApiService implements Service {
240240
})
241241
} catch (error) {
242242
console.log('Prisma create post error:', error)
243-
throw new Error('Failed to create post')
243+
throw error
244244
}
245245
}
246246

@@ -336,7 +336,7 @@ export class PostApiService implements Service {
336336
return { data: { ...data }, isPublish, post, userId: signedUserId, series_id }
337337
}
338338
private async generateUrlSlug({ input, urlSlug, userId }: GenerateUrlSlugArgs) {
339-
let processedUrlSlug = this.utils.escapeForUrl(urlSlug)
339+
let processedUrlSlug = this.utils.escapeForUrl(urlSlug).slice(0, 240)
340340
const urlSlugDuplicate = await this.db.post.findFirst({
341341
where: {
342342
fk_user_id: userId,

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)