|
@ -68,7 +68,7 @@ |
|
|
<span v-if="record.agentDid == contact.did"> |
|
|
<span v-if="record.agentDid == contact.did"> |
|
|
<div class="font-bold"> |
|
|
<div class="font-bold"> |
|
|
{{ record.amount }} {{ record.unit }} |
|
|
{{ record.amount }} {{ record.unit }} |
|
|
<span v-if="record.confirmed" class="tooltip"> |
|
|
<span v-if="record.amountConfirmed" class="tooltip"> |
|
|
<fa icon="circle-check" class="text-green-600 fa-fw ml-1" /> |
|
|
<fa icon="circle-check" class="text-green-600 fa-fw ml-1" /> |
|
|
<span class="tooltiptext">Confirmed</span> |
|
|
<span class="tooltiptext">Confirmed</span> |
|
|
</span> |
|
|
</span> |
|
@ -94,7 +94,7 @@ |
|
|
<span v-if="record.agentDid != contact.did"> |
|
|
<span v-if="record.agentDid != contact.did"> |
|
|
<div class="font-bold"> |
|
|
<div class="font-bold"> |
|
|
{{ record.amount }} {{ record.unit }} |
|
|
{{ record.amount }} {{ record.unit }} |
|
|
<span v-if="record.confirmed" class="tooltip"> |
|
|
<span v-if="record.amountConfirmed" class="tooltip"> |
|
|
<fa icon="circle-check" class="text-green-600 fa-fw ml-1" /> |
|
|
<fa icon="circle-check" class="text-green-600 fa-fw ml-1" /> |
|
|
<span class="tooltiptext">Confirmed</span> |
|
|
<span class="tooltiptext">Confirmed</span> |
|
|
</span> |
|
|
</span> |
|
@ -134,10 +134,8 @@ import { AppString } from "@/constants/app"; |
|
|
import { accessToken, SimpleSigner } from "@/libs/crypto"; |
|
|
import { accessToken, SimpleSigner } from "@/libs/crypto"; |
|
|
import { |
|
|
import { |
|
|
AgreeVerifiableCredential, |
|
|
AgreeVerifiableCredential, |
|
|
GiveServerRecord, |
|
|
GiveServerRecord, GiveVerifiableCredential, |
|
|
RegisterVerifiableCredential, |
|
|
|
|
|
SCHEMA_ORG_CONTEXT, |
|
|
SCHEMA_ORG_CONTEXT, |
|
|
SERVICE_ID, |
|
|
|
|
|
} from "@/libs/endorserServer"; |
|
|
} from "@/libs/endorserServer"; |
|
|
import * as didJwt from "did-jwt"; |
|
|
import * as didJwt from "did-jwt"; |
|
|
import { AxiosError } from "axios"; |
|
|
import { AxiosError } from "axios"; |
|
@ -243,7 +241,9 @@ export default class ContactsView extends Vue { |
|
|
async confirm(record: GiveServerRecord) { |
|
|
async confirm(record: GiveServerRecord) { |
|
|
// Make claim |
|
|
// Make claim |
|
|
// I use clone here because otherwise it gets a Proxy object. |
|
|
// I use clone here because otherwise it gets a Proxy object. |
|
|
const origClaim: Record<any, any> = R.clone(record.fullClaim); |
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
|
|
|
|
|
const origClaim: GiveVerifiableCredential = |
|
|
|
|
|
R.clone(record.fullClaim); |
|
|
if (record.fullClaim["@context"] == SCHEMA_ORG_CONTEXT) { |
|
|
if (record.fullClaim["@context"] == SCHEMA_ORG_CONTEXT) { |
|
|
delete origClaim["@context"]; |
|
|
delete origClaim["@context"]; |
|
|
} |
|
|
} |
|
@ -294,7 +294,7 @@ export default class ContactsView extends Vue { |
|
|
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); |
|
|
//console.log("Got resp data:", resp.data); |
|
|
if (resp.data?.success) { |
|
|
if (resp.data?.success) { |
|
|
record.confirmed = 1; |
|
|
record.amountConfirmed = origClaim.object?.amountOfThisGood || 1; |
|
|
} |
|
|
} |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
let userMessage = "There was an error. See logs for more info."; |
|
|
let userMessage = "There was an error. See logs for more info."; |
|
|