allow editing of an offer
This commit is contained in:
@@ -62,6 +62,7 @@ export interface GenericCredWrapper<T extends GenericVerifiableCredential> {
|
||||
id: string;
|
||||
issuedAt: string;
|
||||
issuer: string;
|
||||
publicUrls?: Record<string, string>; // only for IDs that want to be public
|
||||
}
|
||||
export const BLANK_GENERIC_SERVER_RECORD: GenericCredWrapper<GenericVerifiableCredential> =
|
||||
{
|
||||
@@ -734,10 +735,10 @@ export function hydrateOffer(
|
||||
vcClaimOrig?: OfferVerifiableCredential,
|
||||
fromDid?: string,
|
||||
toDid?: string,
|
||||
conditionDescription?: string,
|
||||
itemDescription?: string,
|
||||
amount?: number,
|
||||
unitCode?: string,
|
||||
offeringDescription?: string,
|
||||
conditionDescription?: string,
|
||||
fulfillsProjectHandleId?: string,
|
||||
validThrough?: string,
|
||||
lastClaimId?: string,
|
||||
@@ -766,9 +767,9 @@ export function hydrateOffer(
|
||||
? { amountOfThisGood: amount, unitCode: unitCode || "HUR" }
|
||||
: undefined;
|
||||
|
||||
if (offeringDescription || fulfillsProjectHandleId) {
|
||||
if (itemDescription || fulfillsProjectHandleId) {
|
||||
vcClaim.itemOffered = vcClaim.itemOffered || {};
|
||||
vcClaim.itemOffered.description = offeringDescription || undefined;
|
||||
vcClaim.itemOffered.description = itemDescription || undefined;
|
||||
if (fulfillsProjectHandleId) {
|
||||
vcClaim.itemOffered.isPartOf = {
|
||||
"@type": "PlanAction",
|
||||
@@ -794,9 +795,10 @@ export async function createAndSubmitOffer(
|
||||
axios: Axios,
|
||||
apiServer: string,
|
||||
issuerDid: string,
|
||||
description?: string,
|
||||
itemDescription: string,
|
||||
amount?: number,
|
||||
unitCode?: string,
|
||||
conditionDescription?: string,
|
||||
validThrough?: string,
|
||||
recipientDid?: string,
|
||||
fulfillsProjectHandleId?: string,
|
||||
@@ -805,10 +807,10 @@ export async function createAndSubmitOffer(
|
||||
undefined,
|
||||
issuerDid,
|
||||
recipientDid,
|
||||
description,
|
||||
itemDescription,
|
||||
amount,
|
||||
unitCode,
|
||||
description,
|
||||
conditionDescription,
|
||||
fulfillsProjectHandleId,
|
||||
validThrough,
|
||||
undefined,
|
||||
@@ -826,9 +828,10 @@ export async function editAndSubmitOffer(
|
||||
apiServer: string,
|
||||
fullClaim: GenericCredWrapper<OfferVerifiableCredential>,
|
||||
issuerDid: string,
|
||||
description?: string,
|
||||
itemDescription: string,
|
||||
amount?: number,
|
||||
unitCode?: string,
|
||||
conditionDescription?: string,
|
||||
validThrough?: string,
|
||||
recipientDid?: string,
|
||||
fulfillsProjectHandleId?: string,
|
||||
@@ -837,10 +840,10 @@ export async function editAndSubmitOffer(
|
||||
fullClaim.claim,
|
||||
issuerDid,
|
||||
recipientDid,
|
||||
description,
|
||||
itemDescription,
|
||||
amount,
|
||||
unitCode,
|
||||
description,
|
||||
conditionDescription,
|
||||
fulfillsProjectHandleId,
|
||||
validThrough,
|
||||
fullClaim.id,
|
||||
|
||||
Reference in New Issue
Block a user