Skip to content

Commit

Permalink
Merge pull request #36 from CambioML/jojo-branch
Browse files Browse the repository at this point in the history
add new Insights Dashboard; wip Dashboards
  • Loading branch information
Cambio ML authored Aug 29, 2024
2 parents b91ee84 + 2fd0719 commit 6d519f1
Show file tree
Hide file tree
Showing 32 changed files with 1,958 additions and 39 deletions.
21 changes: 21 additions & 0 deletions app/actions/insightDashboard/getUserData.ts
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;
});
};
19 changes: 19 additions & 0 deletions app/actions/insightDashboard/postUser.ts
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;
});
};
Loading

0 comments on commit 6d519f1

Please sign in to comment.