allow to switch the server

This commit is contained in:
2023-05-19 13:28:52 -06:00
parent 30b8b941ae
commit fc7c1187e8
12 changed files with 98 additions and 38 deletions

View File

@@ -101,6 +101,7 @@ interface VerifiableCredential {
})
export default class NewEditProjectView extends Vue {
activeDid = "";
apiServer = "";
projectName = "";
description = "";
errorMessage = "";
@@ -116,6 +117,7 @@ export default class NewEditProjectView extends Vue {
await db.open();
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
this.activeDid = settings?.activeDid || "";
this.apiServer = settings?.apiServer || "";
if (this.projectId) {
await accountsDB.open();
@@ -132,9 +134,8 @@ export default class NewEditProjectView extends Vue {
}
async LoadProject(identity: IIdentifier) {
const endorserApiServer = AppString.DEFAULT_ENDORSER_API_SERVER;
const url =
endorserApiServer +
this.apiServer +
"/api/claim/byHandle/" +
encodeURIComponent(this.projectId);
const token = await accessToken(identity);
@@ -191,8 +192,7 @@ export default class NewEditProjectView extends Vue {
// Make the xhr request payload
const payload = JSON.stringify({ jwtEncoded: vcJwt });
const endorserApiServer = AppString.DEFAULT_ENDORSER_API_SERVER;
const url = endorserApiServer + "/api/v2/claim";
const url = this.apiServer + "/api/v2/claim";
const token = await accessToken(identity);
const headers = {
"Content-Type": "application/json",