Skip to content

Commit

Permalink
Merge pull request #1095 from DeepBlueCLtd/1094_correct_prod_URL
Browse files Browse the repository at this point in the history
Correctly build URL in production
  • Loading branch information
IanMayo authored May 2, 2024
2 parents bbd9441 + bd16352 commit ee2dba7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/providers/authProvider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ const createUserToken = async (
// previousData
// })
// }
const BASE_URL = process.env.NODE_ENV === 'development' ?? 'http://localhost:8000'
const BASE_URL =
process.env.NODE_ENV === 'development' ? 'http://localhost:8000' : ''
const fetchUser = async (username: string): Promise<any> => {

const user = await axios.get(
`${BASE_URL}/api/tables/_users/rows?_filters=username:${username}`
)
Expand Down
3 changes: 2 additions & 1 deletion src/providers/authProvider/permissions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import axios, { type AxiosResponse } from 'axios'
import * as constants from '../../constants'
const BASE_URL = process.env.NODE_ENV === 'development' ?? 'http://localhost:8000'
const BASE_URL =
process.env.NODE_ENV === 'development' ? 'http://localhost:8000' : ''

const getRoleId = async (role: string): Promise<number | undefined> => {
return await axios
Expand Down
3 changes: 2 additions & 1 deletion src/resources/users/UserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ interface UserDetails {
updateBefore: string
}

const BASE_URL = process.env.NODE_ENV === 'development' ?? 'http://localhost:8000'
const BASE_URL =
process.env.NODE_ENV === 'development' ? 'http://localhost:8000' : ''

const SaveButtonContext: React.FC<any> = (props: {
selectUser: string
Expand Down
3 changes: 2 additions & 1 deletion src/resources/users/UserShow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ const UserShowComp = ({
const [update] = useUpdate<_Users>()
const notify = useNotify()

const BASE_URL = process.env.NODE_ENV === 'development' ?? 'http://localhost:8000'
const BASE_URL =
process.env.NODE_ENV === 'development' ? 'http://localhost:8000' : ''

const fetchData = async (): Promise<void> => {
try {
Expand Down

0 comments on commit ee2dba7

Please sign in to comment.