Browse Source

fix problem detecting plans when editing gifts

playwright-pwa-install-test
Trent Larson 4 months ago
parent
commit
375d6ddbe2
  1. 7
      src/views/GiftedDetails.vue

7
src/views/GiftedDetails.vue

@ -249,9 +249,10 @@ export default class GiftedDetails extends Vue {
); );
} }
const prevAmount = this.prevCredToEdit?.claim?.object?.amountOfThisGood;
this.amountInput = this.amountInput =
(this.$route as Router).query["amountInput"] || (this.$route as Router).query["amountInput"] ||
String(this.prevCredToEdit?.claim?.object?.amountOfThisGood) || (prevAmount ? String(prevAmount) : "") ||
this.amountInput; this.amountInput;
this.description = this.description =
(this.$route as Router).query["description"] || (this.$route as Router).query["description"] ||
@ -275,13 +276,13 @@ export default class GiftedDetails extends Vue {
: fulfills : fulfills
? [fulfills] ? [fulfills]
: []; : [];
const offer = fulfillsArray.find((rec) => rec.claimType === "Offer"); const offer = fulfillsArray.find((rec) => rec["@type"] === "Offer");
this.offerId = ((this.$route as Router).query["offerId"] || this.offerId = ((this.$route as Router).query["offerId"] ||
offer?.identifier || offer?.identifier ||
this.offerId) as string; this.offerId) as string;
// find any project ID // find any project ID
const project = fulfillsArray.find((rec) => rec.claimType === "PlanAction"); const project = fulfillsArray.find((rec) => rec["@type"] === "PlanAction");
this.projectId = ((this.$route as Router).query["projectId"] || this.projectId = ((this.$route as Router).query["projectId"] ||
project?.identifier || project?.identifier ||
this.projectId) as string; this.projectId) as string;

Loading…
Cancel
Save