Skip to content

Commit

Permalink
Adding some API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbod committed Sep 24, 2023
1 parent c557cba commit 71e5707
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions ui/src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,48 @@ import axios from 'axios';
defineProps<{ msg: string }>()
currentUser: string = '';
accessTokenExpired: boolean | undefined = false;
isLoggedIn: boolean = false;
data: any;
getDirectApi() {
axios.get(`${this.getCurrentHost()}/api/DirectApi`)
.then((response: any) => {
this.data = response.data;
})
.catch((error: any) => {
alert(error);
});
}
getUserProfile() {
axios.get(`${this.getCurrentHost()}/api/User`)
.then((response: any) => {
this.data = response.data;
})
.catch((error: any) => {
alert(error);
});
}
getGraphApiDataUsingApi() {
axios.get(`${this.getCurrentHost()}/api/GraphApiData`)
.then((response: any) => {
this.data = response.data;
})
.catch((error: any) => {
alert(error);
});
}
getCurrentHost() {
const host = window.location.host;
const url = `${window.location.protocol}//${host}`;
return url;
}
const count = ref(0)
</script>
Expand Down

0 comments on commit 71e5707

Please sign in to comment.