|
@ -122,7 +122,7 @@ export default class NewEditProjectView extends Vue { |
|
|
await accountsDB.open(); |
|
|
await accountsDB.open(); |
|
|
const num_accounts = await accountsDB.accounts.count(); |
|
|
const num_accounts = await accountsDB.accounts.count(); |
|
|
if (num_accounts === 0) { |
|
|
if (num_accounts === 0) { |
|
|
console.log("Problem! Should have a profile!"); |
|
|
console.error("Problem! Should have a profile!"); |
|
|
} else { |
|
|
} else { |
|
|
const accounts = await accountsDB.accounts.toArray(); |
|
|
const accounts = await accountsDB.accounts.toArray(); |
|
|
const account = R.find((acc) => acc.did === this.activeDid, accounts); |
|
|
const account = R.find((acc) => acc.did === this.activeDid, accounts); |
|
@ -145,14 +145,13 @@ export default class NewEditProjectView extends Vue { |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
const resp = await this.axios.get(url, { headers }); |
|
|
const resp = await this.axios.get(url, { headers }); |
|
|
console.log(resp.status, resp.data); |
|
|
|
|
|
if (resp.status === 200) { |
|
|
if (resp.status === 200) { |
|
|
const claim = resp.data.claim; |
|
|
const claim = resp.data.claim; |
|
|
this.projectName = claim.name; |
|
|
this.projectName = claim.name; |
|
|
this.description = claim.description; |
|
|
this.description = claim.description; |
|
|
} |
|
|
} |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.log(error); |
|
|
console.error("Got error retrieving that project", error); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -200,7 +199,6 @@ export default class NewEditProjectView extends Vue { |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
const resp = await this.axios.post(url, payload, { headers }); |
|
|
const resp = await this.axios.post(url, payload, { headers }); |
|
|
console.log("Got resp data:", resp.data); |
|
|
|
|
|
// handleId is new in server v release-1.6.0; remove fullIri when that |
|
|
// handleId is new in server v release-1.6.0; remove fullIri when that |
|
|
// version shows up here: https://endorser.ch:3000/api-docs/ |
|
|
// version shows up here: https://endorser.ch:3000/api-docs/ |
|
|
if (resp.data?.success?.handleId || resp.data?.success?.fullIri) { |
|
|
if (resp.data?.success?.handleId || resp.data?.success?.fullIri) { |
|
@ -217,7 +215,6 @@ export default class NewEditProjectView extends Vue { |
|
|
const route = { |
|
|
const route = { |
|
|
name: "project", |
|
|
name: "project", |
|
|
}; |
|
|
}; |
|
|
console.log(route); |
|
|
|
|
|
that.$router.push(route); |
|
|
that.$router.push(route); |
|
|
}, |
|
|
}, |
|
|
2000, |
|
|
2000, |
|
@ -238,7 +235,10 @@ export default class NewEditProjectView extends Vue { |
|
|
this.alertMessage = JSON.stringify(serverError.toJSON()); |
|
|
this.alertMessage = JSON.stringify(serverError.toJSON()); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
console.log("Here's the full error trying to save the claim:", error); |
|
|
console.error( |
|
|
|
|
|
"Here's the full error trying to save the claim:", |
|
|
|
|
|
error |
|
|
|
|
|
); |
|
|
this.alertTitle = "Claim Error"; |
|
|
this.alertTitle = "Claim Error"; |
|
|
this.alertMessage = error as string; |
|
|
this.alertMessage = error as string; |
|
|
} |
|
|
} |
|
@ -254,7 +254,7 @@ export default class NewEditProjectView extends Vue { |
|
|
await accountsDB.open(); |
|
|
await accountsDB.open(); |
|
|
const num_accounts = await accountsDB.accounts.count(); |
|
|
const num_accounts = await accountsDB.accounts.count(); |
|
|
if (num_accounts === 0) { |
|
|
if (num_accounts === 0) { |
|
|
console.log("Problem! Should have a profile!"); |
|
|
console.error("Problem! Should have a profile!"); |
|
|
} else { |
|
|
} else { |
|
|
const accounts = await accountsDB.accounts.toArray(); |
|
|
const accounts = await accountsDB.accounts.toArray(); |
|
|
const account = R.find((acc) => acc.did === this.activeDid, accounts); |
|
|
const account = R.find((acc) => acc.did === this.activeDid, accounts); |
|
|