Skip to content

Commit

Permalink
fix frontend issue
Browse files Browse the repository at this point in the history
  • Loading branch information
djeck1432 committed Dec 2, 2024
1 parent b10bae6 commit d00d33e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/services/contract.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { connect } from 'get-starknet';
import { getDeployContractData } from 'src/utils/constants';
import { getDeployContractData } from '../utils/constants';
import { axiosInstance } from '../utils/axios';

export async function deployContract(walletId) {
Expand Down
11 changes: 10 additions & 1 deletion frontend/src/services/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CallData } from 'starknet';
import { erc20abi } from '../abis/erc20';
import { abi } from '../abis/abi';
import { axiosInstance } from '../utils/axios';
import {checkAndDeployContract} from './contract';

export async function sendTransaction(loopLiquidityData, contractAddress) {
try {
Expand Down Expand Up @@ -71,7 +72,15 @@ export const handleTransaction = async (connectedWalletId, formData, setError, s

setLoading(true);
setError('');

try{
await checkAndDeployContract(connectedWalletId);
} catch (error) {
console.error('Error deploying contract:', error);
setError('Error deploying contract. Please try again.');
setSuccessful(false)
setLoading(false);
return;
}
try {
const response = await axiosInstance.post(`/api/create-position`, formData);

Expand Down

0 comments on commit d00d33e

Please sign in to comment.