merge conflicts and small bug of page number
parent
5203d5b075
commit
6285be6d40
|
|
@ -286,18 +286,22 @@ export default function KennzahlenTable({
|
|||
)}
|
||||
</TableCell>
|
||||
<TableCell align="center">
|
||||
<Link
|
||||
component="button"
|
||||
onClick={() =>
|
||||
onPageClick?.(
|
||||
Number(row.extractedValues.at(0)?.page),
|
||||
row.extractedValues.at(0)?.entity || "",
|
||||
)
|
||||
}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{row.extractedValues.at(0)?.page}
|
||||
</Link>
|
||||
{(row.extractedValues.at(0)?.page ?? 0) > 0 ? (
|
||||
<Link
|
||||
component="button"
|
||||
onClick={() => {
|
||||
const extractedValue = row.extractedValues.at(0);
|
||||
if (extractedValue?.page && extractedValue.page > 0) {
|
||||
onPageClick?.(Number(extractedValue.page), extractedValue.entity || "");
|
||||
}
|
||||
}}
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
{row.extractedValues.at(0)?.page}
|
||||
</Link>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@ import { useEffect, useState } from "react";
|
|||
import PDFViewer from "../components/pdfViewer";
|
||||
import { fetchPutKPI } from "../util/api";
|
||||
import { kpiQueryOptions } from "../util/query";
|
||||
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
|
||||
import {fetchPutKPI} from "../util/api";
|
||||
import { redirect } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/extractedResult_/$pitchBook/$kpi")({
|
||||
|
|
@ -78,9 +76,21 @@ function ExtractedResultsPage() {
|
|||
const { mutate: updateKPI } = useMutation({
|
||||
mutationFn: () => {
|
||||
const updatedData = { ...kpiData };
|
||||
let baseObject;
|
||||
if (selectedIndex >= 0) {
|
||||
baseObject = kpiValues[selectedIndex];
|
||||
} else {
|
||||
baseObject = {
|
||||
label: kpi.toUpperCase(),
|
||||
entity: selectedValue,
|
||||
page: 0,
|
||||
status: "single-source",
|
||||
source: "manual",
|
||||
};
|
||||
}
|
||||
updatedData[kpi.toUpperCase()] = [
|
||||
{
|
||||
...kpiValues[0],
|
||||
...baseObject,
|
||||
entity: selectedValue,
|
||||
},
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue