Commit e0510d3c authored by Bitcoin Please's avatar Bitcoin Please

Fixed campaign creation.

parent f46455a5
......@@ -525,14 +525,17 @@ export default {
const result = await superagent
.post(target)
.send(pkg)
.catch(err => console.error(err))
console.log('RESULT', result)
if (result.ok && !result.error) {
if (result && result.ok && !result.error) {
this.title = null
this.category = null
this.location = null
this.toast(['Done!', 'New campaign created successfully!', 'success'])
} else {
this.toast(['Oops!', 'Campaign failed to be created, please try again..', 'error'])
}
},
......
......@@ -69,7 +69,7 @@
<div class="process">
<div class="raised">
<span></span>
<span v-if="campaignModel == 'Community Pledge'"></span>
</div>
<div v-if="campaignModel == 'Community Pledge'" class="row process-info">
......
......@@ -15,7 +15,7 @@
<td class="text-center">{{funder.comment}}</td>
<td class="text-center">
{{formatUSD(funder.monthlyPledgeAmt)}}
<small>[ <span class="text-danger">{{funder.payouts.length}}x</span> ]</small>
<small>[ <span class="text-danger">{{funder.payouts ? funder.payouts.length : '0'}}x</span> ]</small>
</td>
<td class="text-right">{{formatDate(funder.createdAt)}}</td>
</tr>
......@@ -157,7 +157,7 @@ export default {
// console.info(`Market price (USD)`, this.usd)
/* Validate assurances. */
if (this.campaign.assurances) {
if (this.campaign && this.campaign.assurances) {
/* Set assurance id. */
const assuranceid = 0 // FIXME: Hard-coded to a single assurance campaign
......@@ -186,7 +186,7 @@ export default {
}
/* Validate payouts. */
if (this.campaign.payouts && this.campaign.payouts.funders) {
if (this.campaign && this.campaign.payouts && this.campaign.payouts.funders) {
/* Set funders. */
const funders = this.campaign.payouts.funders
......
......@@ -62,8 +62,11 @@
</div>
<div class="process">
<div v-if="campaignModel(campaign) == 'Community Pledge'" class="raised">
<span :style="{ width: completedPct(campaign, true) + '%'}"></span>
<div class="raised">
<span
v-if="campaignModel(campaign) == 'Community Pledge'"
:style="{ width: completedPct(campaign, true) + '%'}"
></span>
</div>
<!-- <div class="process-info">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment