Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partially revert c9343d5 to fix investigation issues (#9026) #4

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/Facility/Investigations/Reports/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { chain } from "lodash-es";
import _ from "lodash";
import { useCallback, useReducer, useState } from "react";
import { useTranslation } from "react-i18next";

Expand Down Expand Up @@ -179,7 +179,7 @@ const InvestigationReports = ({ id }: any) => {
),
);

const investigationList = chain(data)
const investigationList = _.chain(data)
.flatMap((i) => i?.data?.results)
.compact()
.flatten()
Expand Down
7 changes: 4 additions & 3 deletions src/components/Facility/Investigations/Reports/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { chain, findIndex, memoize } from "lodash-es";
import _ from "lodash";
import { findIndex, memoize } from "lodash-es";

import { InvestigationResponse } from "@/components/Facility/Investigations/Reports/types";

export const transformData = memoize((data: InvestigationResponse) => {
const sessions = chain(data)
const sessions = _.chain(data)
.map((value: any) => {
return {
...value.session_object,
Expand All @@ -14,7 +15,7 @@ export const transformData = memoize((data: InvestigationResponse) => {
.uniqBy("session_external_id")
.orderBy("session_created_date", "desc")
.value();
const groupByInvestigation = chain(data)
const groupByInvestigation = _.chain(data)
.groupBy("investigation_object.external_id")
.values()
.value();
Expand Down
5 changes: 3 additions & 2 deletions src/components/Facility/Investigations/ShowInvestigation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { chain, set } from "lodash-es";
import _ from "lodash";
import { set } from "lodash-es";
import { useCallback, useReducer } from "react";
import { useTranslation } from "react-i18next";

Expand Down Expand Up @@ -150,7 +151,7 @@ export default function ShowInvestigation(props: ShowInvestigationProps) {
};

const handleUpdateCancel = useCallback(() => {
const changedValues = chain(state.initialValues)
const changedValues = _.chain(state.initialValues)
.map((val: any, _key: string) => ({
id: val?.id,
initialValue: val?.notes || val?.value || null,
Expand Down
Loading