From f0f1e1d57ea1e961fc3b1cfcbd4cb259a77a90d0 Mon Sep 17 00:00:00 2001 From: Yury Shkoda Date: Mon, 4 Oct 2021 16:57:54 +0300 Subject: [PATCH] feat(deploy): add appLoc --- src/routes/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/routes/index.ts b/src/routes/index.ts index 4f36222..48c525f 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -21,7 +21,7 @@ router.get('/', async (req, res) => { }) router.post('/deploy', async (req, res) => { - if (!isFileTree(req.body)) { + if (!isFileTree({ members: req.body.members })) { res.status(400).send({ status: 'failure', message: 'Provided not supported data format.', @@ -31,7 +31,10 @@ router.post('/deploy', async (req, res) => { return } - await createFileTree(req.body.members) + await createFileTree( + req.body.members, + req.body.appLoc ? req.body.appLoc.replace(/^\//, '').split('/') : [] + ) .then(() => { res.status(200).send({ status: 'success',