From 8b0b65c55b8330da5692376cb9342877d00ce084 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Tue, 28 Feb 2023 09:12:00 -0700 Subject: [PATCH] refactor: migrate to handleId (since fullIri will soon be deprecated) --- src/views/NewEditProjectView.vue | 10 ++++++++-- src/views/ProjectsView.vue | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/views/NewEditProjectView.vue b/src/views/NewEditProjectView.vue index b131133..3977c69 100644 --- a/src/views/NewEditProjectView.vue +++ b/src/views/NewEditProjectView.vue @@ -197,11 +197,17 @@ export default class NewEditProjectView extends Vue { try { const resp = await this.axios.post(url, payload, { headers }); console.log("Got resp data:", resp.data); - if (resp.data?.success?.fullIri) { + // handleId is new in server v release-1.6.0; remove fullIri when that + // version shows up here: https://endorser.ch:3000/api-docs/ + if (resp.data?.success?.handleId || resp.data?.success?.fullIri) { this.errorMessage = ""; this.alertTitle = ""; this.alertMessage = ""; - useAppStore().setProjectId(resp.data.success.fullIri); + // handleId is new in server v release-1.6.0; remove fullIri when that + // version shows up here: https://endorser.ch:3000/api-docs/ + useAppStore().setProjectId( + resp.data.success.handleId || resp.data.success.fullIri + ); setTimeout( function (that: Vue) { const route = { diff --git a/src/views/ProjectsView.vue b/src/views/ProjectsView.vue index 1554951..06b8fdc 100644 --- a/src/views/ProjectsView.vue +++ b/src/views/ProjectsView.vue @@ -139,7 +139,9 @@ export default class ProjectsView extends Vue { const data = { name: plan.name, description: plan.description, - handleId: plan.fullIri, + // handleId is new in server v release-1.6.0; remove fullIri when that + // version shows up here: https://endorser.ch:3000/api-docs/ + handleId: plan.handleId || plan.fullIri, }; this.projects.push(data); }