From 37c47cc124fab4548c222a7640483a3b02ee673e Mon Sep 17 00:00:00 2001 From: Victoria Sloan Date: Mon, 22 Jun 2020 17:38:00 +0100 Subject: [PATCH 1/2] setting appId on user object when creating the app instance --- packages/cli/src/commands/new/newHandler.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/commands/new/newHandler.js b/packages/cli/src/commands/new/newHandler.js index 44007acde7..c0d8b4be50 100644 --- a/packages/cli/src/commands/new/newHandler.js +++ b/packages/cli/src/commands/new/newHandler.js @@ -18,7 +18,7 @@ const run = async opts => { console.log(chalk.green(`Budibase app ${opts.name} created!`)) } catch (error) { console.error( - chalk.red("Error creating new app", JSON.stringify(error, { space: 2 })) + chalk.red("Error creating new app", error) ) } } @@ -52,8 +52,10 @@ const createAppInstance = async opts => { const instanceController = require("@budibase/server/src/api/controllers/instance") const createInstCtx = { params: { - clientId: process.env.CLIENT_ID, - applicationId: opts.applicationId, + clientId: process.env.CLIENT_ID + }, + user: { + appId: opts.applicationId }, request: { body: { name: `dev-${process.env.CLIENT_ID}` }, From 2fd2f1de45cdfebdf797e977cd51b0602737e871 Mon Sep 17 00:00:00 2001 From: Victoria Sloan Date: Mon, 22 Jun 2020 18:07:52 +0100 Subject: [PATCH 2/2] linty --- packages/cli/src/commands/new/newHandler.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/cli/src/commands/new/newHandler.js b/packages/cli/src/commands/new/newHandler.js index c0d8b4be50..64c974cdf9 100644 --- a/packages/cli/src/commands/new/newHandler.js +++ b/packages/cli/src/commands/new/newHandler.js @@ -17,9 +17,7 @@ const run = async opts => { exec(`cd ${join(opts.dir, opts.applicationId)} && npm install`) console.log(chalk.green(`Budibase app ${opts.name} created!`)) } catch (error) { - console.error( - chalk.red("Error creating new app", error) - ) + console.error(chalk.red("Error creating new app", error)) } } @@ -52,10 +50,10 @@ const createAppInstance = async opts => { const instanceController = require("@budibase/server/src/api/controllers/instance") const createInstCtx = { params: { - clientId: process.env.CLIENT_ID + clientId: process.env.CLIENT_ID, }, user: { - appId: opts.applicationId + appId: opts.applicationId, }, request: { body: { name: `dev-${process.env.CLIENT_ID}` },