Skip to content

Commit

Permalink
datasets admin
Browse files Browse the repository at this point in the history
  • Loading branch information
mluena committed Sep 17, 2024
1 parent 6a500a5 commit 060b4b7
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions client/src/containers/datasets/changes-to-approve/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,18 @@ export default function FormToApprove() {
const { data: datasetDataPendingToApprove } = useGetDatasetEditSuggestionsId(Number(id), {
populate: "*",
});

const datasetId = datasetDataPendingToApprove?.data?.attributes?.dataset?.data?.id;

// Check previous data for that dataset
const { data: datasetData } = useGetDatasetsId(
Number(datasetId),
Number(id),
{
populate: "*",
},
{
query: {
enabled: !!datasetId,
enabled: !!id,
},
},
);
Expand All @@ -87,7 +88,7 @@ export default function FormToApprove() {
const { data: datasetValuesData } = useGetDatasetValues(
{
filters: {
dataset: datasetId,
dataset: id,
},
"pagination[pageSize]": 300,
populate: {
Expand All @@ -99,7 +100,7 @@ export default function FormToApprove() {
},
{
query: {
enabled: !!datasetId,
enabled: !!id,
},
},
);
Expand Down Expand Up @@ -403,6 +404,15 @@ export default function FormToApprove() {
? []
: getObjectDifferences(formValues.colors, previousData?.colors);

console.info({
formValues,
isNewDataset,
id,
datasetId,
datasetDataPendingToApprove,
datasetData,
});

return (
<>
<div className="flex items-center justify-between py-4 sm:px-10 md:px-24 lg:px-32">
Expand Down

0 comments on commit 060b4b7

Please sign in to comment.