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

@@ -114,6 +114,7 @@ import { IIdentifier } from "@veramo/core";
components: {},
})
export default class ProjectsView extends Vue {
apiServer = "";
projects: { handleId: string; name: string; description: string }[] = [];
onClickLoadProject(id: string) {
@@ -127,8 +128,7 @@ export default class ProjectsView extends Vue {
}
async LoadProjects(identity: IIdentifier) {
const endorserApiServer = AppString.DEFAULT_ENDORSER_API_SERVER;
const url = endorserApiServer + "/api/v2/report/plansByIssuer";
const url = this.apiServer + "/api/v2/report/plansByIssuer";
const token = await accessToken(identity);
const headers = {
"Content-Type": "application/json",
@@ -161,6 +161,7 @@ export default class ProjectsView extends Vue {
await db.open();
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
const activeDid = settings?.activeDid || "";
this.apiServer = settings?.apiServer || "";
await accountsDB.open();
const num_accounts = await accountsDB.accounts.count();