Skip to content

Commit 9a51769

Browse files
committed
add condition body title when null
1 parent 7ebbcef commit 9a51769

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modules/images/usecase/usecase.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Usecase {
2121

2222
public async Store(body: Store) {
2323
const newPath = CustomPathFile(getSlug(body.category), body.file)
24-
body.title = body.file.originalname.replace(RegexExtensionImage, '')
24+
body.title = body.title ?? body.file.originalname.replace(RegexExtensionImage, '')
2525
body.tags.push(body.title, body.category)
2626
const source = readFileSync(body.file.path)
2727

0 commit comments

Comments
 (0)