-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from CambioML/jojo-branch
add new Insights Dashboard; wip Dashboards
- Loading branch information
Showing
32 changed files
with
1,958 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import axios from 'axios'; | ||
|
||
interface IParams { | ||
userId: string; | ||
} | ||
|
||
export const getUserData = async ({ userId }: IParams) => { | ||
return await axios | ||
.get(process.env.NEXT_PUBLIC_INSIGHT_DASHBOARD_API_URL + '/get-user-data', { | ||
params: { | ||
userId: userId, | ||
}, | ||
}) | ||
.then((response) => { | ||
return response.data; | ||
}) | ||
.catch((error) => { | ||
console.error('Error fetching projects. Please try again.'); | ||
throw error; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import axios from 'axios'; | ||
|
||
interface IParams { | ||
userId: string; | ||
} | ||
|
||
export const postUser = async ({ userId }: IParams) => { | ||
return await axios | ||
.post(process.env.NEXT_PUBLIC_INSIGHT_DASHBOARD_API_URL + '/user', { | ||
userId: userId, | ||
}) | ||
.then((response) => { | ||
return response; | ||
}) | ||
.catch((error) => { | ||
console.error('Error adding user. Please try again.'); | ||
throw error; | ||
}); | ||
}; |
Oops, something went wrong.