BOD-36 #comment Fixed issue where one of the values could be null and incorrect values would be shown.
This commit is contained in:
@@ -3,11 +3,27 @@ import { List } from "antd";
|
||||
import Icon from "@ant-design/icons";
|
||||
import { FaArrowRight } from "react-icons/fa";
|
||||
export default function AuditTrailValuesComponent({ oldV, newV }) {
|
||||
console.log("(!oldV & !newV)", !oldV && !newV);
|
||||
console.log("(!oldV & newV)", !oldV && newV);
|
||||
if (!oldV && !newV) return <div></div>;
|
||||
|
||||
if (!oldV && newV)
|
||||
return (
|
||||
<List bordered size="small">
|
||||
{Object.keys(newV).map((key, idx) => (
|
||||
<List.Item key={idx} value={key}>
|
||||
{key}: {JSON.stringify(newV[key])}
|
||||
</List.Item>
|
||||
))}
|
||||
</List>
|
||||
);
|
||||
|
||||
return (
|
||||
<List bordered size="small">
|
||||
{Object.keys(oldV).map((key, idx) => (
|
||||
<List.Item key={idx} value={key}>
|
||||
{key}: {oldV[key]} <Icon component={FaArrowRight} /> {newV[key]}
|
||||
<List.Item key={idx}>
|
||||
{key}: {oldV[key]} <Icon component={FaArrowRight} />
|
||||
{JSON.stringify(newV[key])}
|
||||
</List.Item>
|
||||
))}
|
||||
</List>
|
||||
|
||||
Reference in New Issue
Block a user