[Update] Add some color on console.log for preventing mix up with code 348.
and show result data when received invalid endpoint that when receive route is not ready to implement yet.
This commit is contained in:
@@ -123,11 +123,11 @@ export const useReceiveRoutes = () => {
|
|||||||
switch (parsed_data.status) {
|
switch (parsed_data.status) {
|
||||||
case 200:
|
case 200:
|
||||||
const route = routes[parsed_data.endpoint];
|
const route = routes[parsed_data.endpoint];
|
||||||
(route) ? route(parsed_data.result) : console.error(`Invalid endpoint: ${parsed_data.endpoint}`);
|
(route) ? route(parsed_data.result) : console.error(`Invalid endpoint: ${parsed_data.endpoint}\nresult: ${JSON.stringify(parsed_data.result)}`);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 348:
|
case 348:
|
||||||
console.log("from backend:", parsed_data);
|
console.log(`from backend: %c ${JSON.stringify(parsed_data)}`, style_348);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -138,3 +138,7 @@ export const useReceiveRoutes = () => {
|
|||||||
};
|
};
|
||||||
return { receiveRoutes };
|
return { receiveRoutes };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const style_348 = [
|
||||||
|
"color: gray",
|
||||||
|
].join(";");
|
||||||
Reference in New Issue
Block a user