const handleSendToWallet = async () => {
setSending(true);
try {
const chaabi = await SecureStore.getItemAsync(‘chaabi’);
const walletId = ‘1bde7b42-659b-4fa7-a8c7-290a7915774b’; // Use the correct wallet ID
const response = await axios.put(
`http://192.168.1.38:1337/api/wallets?filters[contractoruid][$eq]=${walletId}`,
{
data: {
commission: 10,
}
},
{
headers: {
'Authorization': `Bearer ${chaabi}`,
'Content-Type': 'application/json',
},
}
);
console.log('Response:', response.data);
Alert.alert('Success', 'Tokens sent to wallet successfully');
} catch (error) {
console.error('Error sending tokens to wallet:', error.response ? error.response.data : error.message);
Alert.alert('Error', 'Failed to send tokens to wallet');
} finally {
setSending(false);
}
};
showing 405 error every thing is right on frontend but in backend I don’t know whats going wrong with it yesterday it was taking put request smoothly