File tree Expand file tree Collapse file tree 5 files changed +17
-27
lines changed
packages/tdb-dashboard/src/hooks Expand file tree Collapse file tree 5 files changed +17
-27
lines changed Original file line number Diff line number Diff line change 11import { useState } from "react"
22import axios from "axios"
33import { WOQLClientObj } from '../init-woql-client'
4- import { getOptions } from "./hookUtils"
4+ import { getOptions , getBaseUrl } from "./hookUtils"
55//import history from "../routing/history"
66//use access control
7- function getBaseUrl ( ) {
8- /*
9- * link to the node server
10- */
11- let remote_url = ''
12- if ( process . env . TERMINUSDB_SERVER ) {
13- remote_url += process . env . TERMINUSDB_SERVER . endsWith ( '/' ) ? process . env . TERMINUSDB_SERVER : process . env . TERMINUSDB_SERVER + '/'
14- }
15- return `${ remote_url } api`
16- }
177export const AcceptInvitationHook = ( ) => {
188 const axiosHub = axios . create ( ) ;
199
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ export const AccessTokenHook=(organization)=> {
3232 const token = await getTokenSilently ( )
3333 const options = getOptions ( token ) ;
3434 const response = await axiosHub . get ( `${ baseUrl } /organizations/${ organization } /tokens` , options )
35- console . log ( response )
3635 if ( response . data ) {
3736 setTokenList ( response . data )
3837 }
@@ -51,8 +50,8 @@ export const AccessTokenHook=(organization)=> {
5150 */
5251 const Auth0token = await getTokenSilently ( )
5352 const options = getOptions ( Auth0token ) ;
54- await axiosHub . delete ( `${ baseUrl } /organizations/${ organization } /tokens/${ tokenId } ` , options )
55- await getTokenList ( )
53+ await axiosHub . delete ( `${ baseUrl } /organizations/${ organization } /tokens/${ tokenId } ` , options )
54+ getTokenList ( )
5655 setToken ( null )
5756
5857 } catch ( err ) {
Original file line number Diff line number Diff line change 11import { useState , useEffect } from "react"
22import axios from "axios"
33import { useAuth0 } from "../react-auth0-spa"
4- import { getOptions } from "./hookUtils"
4+ import { getOptions , getBaseUrl } from "./hookUtils"
55
6- function getBaseUrl ( ) {
7- /*
8- * link to the node server
9- */
10- let remote_url = ''
11- if ( process . env . TERMINUSDB_SERVER ) {
12- remote_url += process . env . TERMINUSDB_SERVER . endsWith ( '/' ) ? process . env . TERMINUSDB_SERVER : process . env . TERMINUSDB_SERVER + '/'
13- }
14- return `${ remote_url } api`
15- }
166export const CreateNewOrg = ( ) => {
177 const axiosHub = axios . create ( ) ;
188 const { getTokenSilently } = useAuth0 ( )
Original file line number Diff line number Diff line change 11import { useState , useEffect } from "react"
22import axios from "axios"
3- import { getBaseUrl , getOptions } from "./hookUtils"
3+ import { getBaseUrlFeedback , getOptions } from "./hookUtils"
44import { WOQLClientObj } from '../init-woql-client'
55
66export function SendEmailHook ( props ) {
@@ -11,7 +11,7 @@ export function SendEmailHook(props) {
1111 const [ emailError , setEmailError ] = useState ( false )
1212 const [ loadingEmail , setEmailLoading ] = useState ( false )
1313
14- const baseUrl = getBaseUrl ( )
14+ const baseUrl = getBaseUrlFeedback ( )
1515
1616 useEffect ( ( ) => {
1717 async function callEmailServer ( ) {
Original file line number Diff line number Diff line change @@ -15,6 +15,17 @@ export function getOptions(token){
1515export function getBaseUrl ( ) {
1616 /*
1717 * link to the node server
18+ */
19+ let remote_url = ''
20+ if ( process . env . TERMINUSDB_SERVER ) {
21+ remote_url += process . env . TERMINUSDB_SERVER . endsWith ( '/' ) ? process . env . TERMINUSDB_SERVER : process . env . TERMINUSDB_SERVER + '/'
22+ }
23+ return `${ remote_url } api`
24+ }
25+
26+ export function getBaseUrlFeedback ( ) {
27+ /*
28+ * link to the node server
1829 */
1930 let remote_url = ''
2031 if ( process . env . FEEDBACK_URL ) {
You can’t perform that action at this time.
0 commit comments