Skip to content

Commit

Permalink
fixed some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishwas1 committed Mar 27, 2024
1 parent aaf2c4a commit 8dfa7b5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
22 changes: 22 additions & 0 deletions src/store/mainStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ const mainStore = {

fetchAppsUsersSessions: ({ commit, getters }) => {
return new Promise((resolve, reject) => {
if (!getters.getSelectedService || !getters.getSelectedService.tenantUrl) {
return reject(new Error('Tenant url is null or empty, service is not selected'))
}
const url = `${sanitizeUrl(getters.getSelectedService.tenantUrl)}/api/v1/e-kyc/verification/session`;
const authToken = getters.getSelectedService.access_token
const headers = UtilsMixin.methods.getHeader(authToken);
Expand All @@ -329,6 +332,9 @@ const mainStore = {
fetchSessionsDetailsById: ({ commit, getters }, payload) => {
return new Promise((resolve, reject) => {
const { sessionId } = payload
if (!getters.getSelectedService || !getters.getSelectedService.tenantUrl) {
return reject(new Error('Tenant url is null or empty, service is not selected'))
}
const url = `${sanitizeUrl(getters.getSelectedService.tenantUrl)}/api/v1/e-kyc/verification/session/${sessionId}`;
const authToken = getters.getSelectedService.access_token
const headers = UtilsMixin.methods.getHeader(authToken);
Expand All @@ -351,6 +357,9 @@ const mainStore = {
fetchDIDsForAService({ commit, getters, dispatch }) {
return new Promise(function (resolve, reject) {
{
if (!getters.getSelectedService || !getters.getSelectedService.tenantUrl) {
return reject(new Error('Tenant url is null or empty, service is not selected'))
}
const url = `${sanitizeUrl(getters.getSelectedService.tenantUrl)}/api/v1/did?page=1&limit=10`;
const options = {
method: "GET",
Expand Down Expand Up @@ -395,6 +404,10 @@ const mainStore = {
resolveDIDForAService({ commit, getters, }, payload) {
return new Promise(function (resolve, reject) {
{

if (!getters.getSelectedService || !getters.getSelectedService.tenantUrl) {
return reject(new Error('Tenant url is null or empty, service is not selected'))
}
const url = `${sanitizeUrl(getters.getSelectedService.tenantUrl)}/api/v1/did/resolve/${payload}`;
const options = {
method: "GET",
Expand Down Expand Up @@ -433,6 +446,9 @@ const mainStore = {
createDIDsForAService({ commit, getters, dispatch }, payload) {
return new Promise(function (resolve, reject) {
{
if (!getters.getSelectedService || !getters.getSelectedService.tenantUrl) {
return reject(new Error('Tenant url is null or empty, service is not selected'))
}
const url = `${sanitizeUrl(getters.getSelectedService.tenantUrl)}/api/v1/did/create`;
const options = {
method: "POST",
Expand Down Expand Up @@ -479,6 +495,9 @@ const mainStore = {
}
//fetct all dids
{
if (!getters.getSelectedService || !getters.getSelectedService.tenantUrl) {
return reject(new Error('Tenant url is null or empty, service is not selected'))
}
const url = `${sanitizeUrl(getters.getSelectedService.tenantUrl)}/api/v1/did/register`;
const options = {
method: "POST",
Expand Down Expand Up @@ -517,6 +536,9 @@ const mainStore = {
}
//fetct all dids
{
if (!getters.getSelectedService || !getters.getSelectedService.tenantUrl) {
return reject(new Error('Tenant url is null or empty, service is not selected'))
}
const url = `${sanitizeUrl(getters.getSelectedService.tenantUrl)}/api/v1/did/`;
const options = {
method: "PATCH",
Expand Down
4 changes: 2 additions & 2 deletions src/views/playground/DID.vue
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,9 @@ export default {
await this.fetchDIDsForAService()
this.isLoading = false
} catch (e) {
console.error(e)
this.isLoading = false
this.notifyErr(e.message)
this.$router.push({path: '/studio/dashboard'});
}
},
beforeRouteEnter(to, from, next) {
Expand Down
2 changes: 2 additions & 0 deletions src/views/playground/Sessions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,11 @@ export default {
this.isLoading = true
await this.fetchAppsUsersSessions({ appId: "" })
this.isLoading = false
}catch(e){
this.isLoading = false
this.notifyErr(e)
this.$router.push({path: '/studio/dashboard'});
}
},
beforeRouteEnter(to, from, next) {
Expand Down

0 comments on commit 8dfa7b5

Please sign in to comment.