refactor(sql): improved the return function to show data [] when not connected, prevents crashes
This commit is contained in:
@@ -16,7 +16,7 @@ export const getOpenOrders = async (data: any | null) => {
|
||||
data: plantError,
|
||||
};
|
||||
}
|
||||
let orders = [];
|
||||
let orders: any = [];
|
||||
|
||||
let updatedQuery = openOrders;
|
||||
|
||||
@@ -37,7 +37,11 @@ export const getOpenOrders = async (data: any | null) => {
|
||||
try {
|
||||
orders = await query(updatedQuery, "Get active openorders");
|
||||
} catch (error) {
|
||||
return { success: false, message: "Current open orders", data: orders };
|
||||
return {
|
||||
success: false,
|
||||
message: "Current open orders",
|
||||
data: orders.data,
|
||||
};
|
||||
}
|
||||
|
||||
// add plant token in
|
||||
|
||||
Reference in New Issue
Block a user