added test code for checking working a request on spsystems, payments modal

This commit is contained in:
Kostya
2023-12-13 17:23:23 +03:00
parent 3d276ffc13
commit 40cacebed7
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import { Post } from '../rest/RestMethods.js';
// import { BackendApiUrl } from '@/properties/Сonfig.js';
export async function GettingMoneyOperation(amount) {
try {
const response = await Post('https://spsystemcore20231122004605.azurewebsites.net/api/Payment', amount)
console.log(response)
return response
}
catch (e) {
console.error('Error in ClaimMoney method: ', e)
}
}

View File

@@ -45,6 +45,7 @@
<script>
import '@/assets/css/ComponentsStyles/payments-modal.css'
import PaymentsModalNumbers from "@/mocks/PaymentsModalNumbers";
import { GettingMoneyOperation } from "@/assets/js/moneyoperation/Claimmoney";
export default {
props: [
@@ -55,9 +56,27 @@ export default {
amount: 1,
card: 0,
clickedBtn: '',
url: '',
PaymentsModalNumbers
}
},
watch: {
amount(newAmount) {
console.log(newAmount)
setTimeout(() => {
try {
GettingMoneyOperation(newAmount)
.then((response) => {
console.log('Payments Modal Working!: ', response)
this.url = response.url
})
}
catch (e) {
console.error('Error in PaymentModal!', e)
}
}, 2000)
}
},
methods: {
closeModal() {
return this.$emit('closemodal')