File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
packages/velog-server/src/services/PostApiService Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,8 @@ export class PostApiService implements Service {
163
163
throw new BadRequestError ( 'Title is empty' )
164
164
}
165
165
166
+ data . title = data . title . slice ( 0 , 255 ) ?? ''
167
+
166
168
const isPublish = ! data . is_temp && ! data . is_private
167
169
168
170
const country = geoip . lookup ( ip ) ?. country ?? ''
@@ -218,6 +220,7 @@ export class PostApiService implements Service {
218
220
data : {
219
221
...( data as Omit < WritePostInput , 'tags' | 'token' | 'series_id' > ) ,
220
222
fk_user_id : signedUserId ,
223
+ title : data . title . slice ( 0 , 255 ) ,
221
224
} ,
222
225
include : {
223
226
user : true ,
@@ -323,11 +326,13 @@ export class PostApiService implements Service {
323
326
324
327
if ( isEditArgs && urlSlugDuplicate && urlSlugDuplicate . id !== input . id ) {
325
328
const randomString = generate ( 8 )
329
+ processedUrlSlug = processedUrlSlug . slice ( 0 , 245 )
326
330
processedUrlSlug += `-${ randomString } `
327
331
}
328
332
329
333
if ( ! isEditArgs && urlSlugDuplicate ) {
330
334
const randomString = generate ( 8 )
335
+ processedUrlSlug = processedUrlSlug . slice ( 0 , 245 )
331
336
processedUrlSlug += `-${ randomString } `
332
337
}
333
338
You can’t perform that action at this time.
0 commit comments