Skip to content

Commit

Permalink
add condition body title when null
Browse files Browse the repository at this point in the history
  • Loading branch information
ayocodingit committed Feb 6, 2024
1 parent 7ebbcef commit 9a51769
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/images/usecase/usecase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Usecase {

public async Store(body: Store) {
const newPath = CustomPathFile(getSlug(body.category), body.file)
body.title = body.file.originalname.replace(RegexExtensionImage, '')
body.title = body.title ?? body.file.originalname.replace(RegexExtensionImage, '')
body.tags.push(body.title, body.category)
const source = readFileSync(body.file.path)

Expand Down

0 comments on commit 9a51769

Please sign in to comment.