Tati преди 7 години
родител
ревизия
06d98d84ba
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      ktchn/src/recipes/controller.ts

+ 1 - 1
ktchn/src/recipes/controller.ts

@@ -11,7 +11,7 @@ const saveRecipe = (db: IMongoService) => ({ body }: Request, res: Response, nex
     db.insertOne(body).then(DBRecipe => {
       res.json(DBRecipe);
       next();
-    })
+    }).catch(error => { next(error) })
   } else {
     next(new Error('Missing recipe information'));
   }