Skip to content

Commit 90d3744

Browse files
authored
Merge pull request #528 from bluewave-labs/develop
Develop -> Master
2 parents b444dd1 + e3cf460 commit 90d3744

File tree

11 files changed

+28
-11
lines changed

11 files changed

+28
-11
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ NODE_ENV - node environment (production, test or development)
140140

141141
It is set from the .env file in the root directory
142142

143-
2. Api Url
143+
2. Backend Url
144144

145145
```
146-
API_BASE_URL - Backend API url
146+
BASE_URL - Backend url
147147
```
148148

149149
It is set from ./frontend/src/utils/constant.js

backend/src/controllers/team.controller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const setOrganisation = async (req, res) => {
1414
return res.status(400).json({ error: 'Cannot create more than one team.' });
1515
}
1616

17-
const newOrg = await teamService.createTeam(name);
17+
const newOrg = await teamService.createTeamWithAgentUrl(name);
1818
return res.status(201).json({
1919
status: 201,
2020
message: 'Organization created successfully',

backend/src/service/team.service.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const { where } = require("sequelize");
21
const settings = require("../../config/settings");
32
const db = require("../models");
43
const Team = db.Team;
@@ -21,6 +20,20 @@ class TeamService {
2120
}
2221
}
2322

23+
async createTeamWithAgentUrl(name) {
24+
const transaction = await sequelize.transaction();
25+
const agentUrl = 'https://cdn.jsdelivr.net/gh/bluewave-labs/[email protected]/jsAgent/'
26+
try {
27+
const team = await Team.create({ name, agentUrl }, { transaction });
28+
await transaction.commit();
29+
return team;
30+
} catch (err) {
31+
await transaction.rollback();
32+
throw new Error("Failed to create team");
33+
}
34+
}
35+
36+
2437
async getTeam() {
2538
try {
2639
const team = await Team.findOne({

frontend/dist/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Guidefox</title>
88
<link rel="icon" type="image/svg+xml" href="/svg/favicon.svg" />
9-
<script type="module" crossorigin src="/assets/index-4Qqfvg46.js"></script>
10-
<link rel="stylesheet" crossorigin href="/assets/index-B2RrmTqS.css">
9+
<script type="module" crossorigin src="/assets/index-BJhRV-7j.js"></script>
10+
<link rel="stylesheet" crossorigin href="/assets/index-ZKMHXvUn.css">
1111
</head>
1212

1313
<body>
File renamed without changes.
File renamed without changes.

frontend/src/components/Button/GoogleSignInButton/GoogleSignInButton.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import GoogleIconSvg from '../../../assets/google-icon.svg';
3+
import GoogleIconSvg from '../../../assets/icons/google-icon.svg';
44
import './GoogleSignInButton.css';
55

66
const GoogleSignInButton = ({ text='Sign in with Google', onClick = () => {}}) => {

frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/List/ListItem/ListItem.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import { IconButton, useTheme } from '@mui/material';
4-
import { DuplicateIcon, EditIcon, TrashIcon } from '../../../../../../public/svg/utilityIcons';
4+
import { DuplicateIcon, EditIcon, TrashIcon } from '../../../../../assets/icons/utilityIcons';
55
import CircleIcon from '@mui/icons-material/Circle';
66
import './ListItem.css';
77
import { useAuth } from '../../../../../services/authProvider';

frontend/src/utils/constants.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
// API constants
22
//local environment
3-
export const API_BASE_URL = 'http://localhost:3000/api/';
3+
export const BASE_URL = 'localhost:3000';
4+
export const API_BASE_URL = `http://${BASE_URL}/api/`;
45

56
//staging environment
6-
// export const API_BASE_URL = 'https://onboarding-demo.bluewavelabs.ca/api/';
7+
// export const BASE_URL = 'onboarding-demo.bluewavelabs.ca';
8+
// export const API_BASE_URL = `https://${BASE_URL}/api/`;
79
// Other constants
810
export const APP_TITLE = 'Bluewave Onboarding';
911
export const SUPPORT_EMAIL = '[email protected]';

frontend/vite.config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { defineConfig } from 'vite';
22
import react from '@vitejs/plugin-react-swc';
3+
import { BASE_URL } from './src/utils/constants';
34

45
export default defineConfig({
56
base: '/',
67
plugins: [react()],
78
server: {
89
host: '0.0.0.0',
9-
port: 4173
10+
port: 4173,
11+
allowedHosts: [BASE_URL]
1012
},
1113
css: {
1214
preprocessorOptions: {

0 commit comments

Comments
 (0)