Skip to content

Commit

Permalink
fix: create org v2
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Mar 8, 2022
1 parent d2024a2 commit f607a31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/config/config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const fs = require('fs');
// and then changing the CWD to the actual ClimateWarehouse directory allows it to run launched from the UI or in
// from $HOME or the actual directory in terminal
try {
fs.accessSync('./ClimateWarehouse/data.sqlite3')
fs.accessSync('./ClimateWarehouse/data.sqlite3');
process.chdir('./ClimateWarehouse');
} catch (err) {}

Expand All @@ -18,6 +18,11 @@ module.exports = {
storage: './data.sqlite3',
logging: false,
},
simulator: {
dialect: 'sqlite',
storage: './simulator.sqlite3',
logging: false,
},
test: {
dialect: 'sqlite',
storage: './test.sqlite3',
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/organization.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const createV2 = async (req, res) => {

const myOrganization = await Organization.getHomeOrg();

if (!myOrganization) {
if (myOrganization) {
return res.json({
message: 'Your organization already exists.',
orgId: myOrganization.orgUid,
Expand All @@ -37,6 +37,7 @@ export const createV2 = async (req, res) => {
});
}
} catch (error) {
console.trace(error);
res.status(400).json({
message: 'Error initiating your organization',
error: error.message,
Expand Down

0 comments on commit f607a31

Please sign in to comment.