Skip to content

Commit

Permalink
Fixed some minor issue in the P2P Admin page
Browse files Browse the repository at this point in the history
  • Loading branch information
ram committed Nov 14, 2024
1 parent d91b20c commit 5e75972
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions web/src/containers/Admin/Trades/p2pActive.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,6 @@ const P2PActive = ({ user }) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const onHandleCancel = async (data) => {
try {
await updateTransaction({
id: data?.id,
user_status: 'cancelled',
});
fetchData();
notificationStatus('cancelled');
setSelectedTransaction(data);
} catch (error) {
console.error(error);
}
};

const notificationStatus = (status, title = '') => {
webSocket.send(
JSON.stringify({
Expand All @@ -155,20 +141,34 @@ const P2PActive = ({ user }) => {
{
action: 'getStatus',
data: {
id: selectedTransaction?.id,
id: userData?.id,
status,
title,
receiver_id:
user?.id === selectedTransaction?.merchant_id
? selectedTransaction?.user_id
: selectedTransaction?.merchant_id,
user?.id === userData?.merchant_id
? userData?.user_id
: userData?.merchant_id,
},
},
],
})
);
};

const onHandleCancel = async (data) => {
try {
await updateTransaction({
id: data?.id,
user_status: 'cancelled',
});
fetchData();
notificationStatus('cancelled');
setSelectedTransaction(data);
} catch (error) {
console.error(error);
}
};

const filteredOrders = getOrders?.data?.filter(
(data) => data?.transaction_status === 'active'
);
Expand Down

0 comments on commit 5e75972

Please sign in to comment.