|
|
@@ -73,6 +73,7 @@ import { ref } from 'vue'; |
|
|
|
import store from '@/store'; |
|
|
|
import { useRouter } from 'vue-router'; |
|
|
|
import FundTierInput from '@/components/FundTierInput.vue'; |
|
|
|
import { sanitize } from '@/lib/helpers'; |
|
|
|
|
|
|
|
const router = useRouter(); |
|
|
|
|
|
|
@@ -89,7 +90,6 @@ const issuerWallet = ref(''); |
|
|
|
const asset = ref(''); |
|
|
|
const memo = ref(''); |
|
|
|
const minContribution = ref(undefined as number | undefined); |
|
|
|
// const amtGoal = ref(undefined as number | undefined); |
|
|
|
|
|
|
|
const bonuses = ref([] as Bonus[]); |
|
|
|
const saveBonuses = (evt: Bonus[]) => { |
|
|
@@ -98,18 +98,19 @@ const saveBonuses = (evt: Bonus[]) => { |
|
|
|
|
|
|
|
const requesting = ref(false); |
|
|
|
const submit = async () => { |
|
|
|
if (!minContribution.value) return; |
|
|
|
if (!/^[0-9]+$/.test(minContribution.value.toString())) return; |
|
|
|
if (!requesting.value) { |
|
|
|
requesting.value = true; |
|
|
|
const resp = await controller.post<SuccessResponse, Partial<FundInfo>>('CreateRewardFund', { |
|
|
|
asset: asset.value, |
|
|
|
fundWallet: fundWallet.value, |
|
|
|
sellingWallet: sellWallet.value, |
|
|
|
issuerWallet: issuerWallet.value, |
|
|
|
memo: memo.value, |
|
|
|
// amountGoal: amtGoal.value as number, |
|
|
|
minContribution: minContribution.value as number, |
|
|
|
title: title.value, |
|
|
|
description: description.value, |
|
|
|
fundWallet: sanitize(fundWallet.value), |
|
|
|
sellingWallet: sanitize(sellWallet.value), |
|
|
|
issuerWallet: sanitize(issuerWallet.value), |
|
|
|
memo: sanitize(memo.value), |
|
|
|
minContribution: minContribution.value, |
|
|
|
title: sanitize(title.value), |
|
|
|
description: sanitize(description.value), |
|
|
|
bonuses: bonuses.value, |
|
|
|
}); |
|
|
|
requesting.value = false; |
|
|
|