Skip to content

Commit

Permalink
fix update spec handler
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilShahi committed Aug 6, 2022
1 parent 24d27d5 commit 1e53381
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/src/api/spec/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export const deleteSpecHandler = async (req: Request, res: Response) => {
export const updateSpecHandler = async (req: Request, res: Response) => {
try {
const specFile = req.file;
const fileName = req.file.filename || req.file.fieldname;
const fileName = specFile.originalname
?.split(".json")[0]
?.split(".yaml")[0]
?.split(".yml")[0];
if (!fileName) {
throw new Error400BadRequest("No filename provided.");
}
Expand Down

0 comments on commit 1e53381

Please sign in to comment.