Skip to content

Commit

Permalink
Split routes of App Router
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Sep 28, 2023
1 parent 9bc19ed commit fa49d0d
Show file tree
Hide file tree
Showing 26 changed files with 481 additions and 413 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const FormReducer = (state = initialState, action: any) => {
}
};

export const UpdateFacilityMiddleware = (props: any) => {
export const FacilityConfigure = (props: any) => {
const [state, dispatch] = useReducer(FormReducer, initialState);
const { facilityId } = props;
const dispatchAction: any = useDispatch();
Expand Down
4 changes: 1 addition & 3 deletions src/Components/Facility/FacilityHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,7 @@ export const FacilityHome = (props: any) => {
</DropdownItem>
<DropdownItem
id="configure-facility"
onClick={() =>
navigate(`/facility/${facilityId}/middleware/update`)
}
onClick={() => navigate(`/facility/${facilityId}/configure`)}
authorizeFor={NonReadOnlyUsers}
icon={<CareIcon className="care-l-setting text-lg" />}
>
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Notifications/ShowPushNotification.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useDispatch } from "react-redux";
import { getNotificationData } from "../../Redux/actions";
import { useEffect } from "react";
import { DetailRoute } from "../../Routers/types";

export default function ShowPushNotification({ external_id }: any) {
export default function ShowPushNotification({ id }: DetailRoute) {
const dispatch: any = useDispatch();

const resultUrl = async () => {
console.log("ID:", external_id.id);
const res = await dispatch(getNotificationData({ id: external_id.id }));
const res = await dispatch(getNotificationData({ id }));
const data = res.data.caused_objects;
switch (res.data.event) {
case "PATIENT_CREATED":
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Patient/FileUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ interface FileUploadProps {
hideBack: boolean;
audio?: boolean;
unspecified: boolean;
sampleId?: number;
sampleId?: string;
claimId?: string;
}

Expand Down
7 changes: 2 additions & 5 deletions src/Components/Patient/SampleDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ import { getTestSample } from "../../Redux/actions";

import { navigate } from "raviger";
import { useDispatch } from "react-redux";
import { DetailRoute } from "../../Routers/types";

const Loading = lazy(() => import("../Common/Loading"));

interface SampleDetailsProps {
id: number;
}

export const SampleDetails = ({ id }: SampleDetailsProps) => {
export const SampleDetails = ({ id }: DetailRoute) => {
const dispatch: any = useDispatch();
const [isLoading, setIsLoading] = useState(false);
const [sampleDetails, setSampleDetails] = useState<SampleTestModel>({});
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Resource/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function ListView() {
const { t } = useTranslation();

const onBoardViewBtnClick = () =>
navigate("/resource/board-view", { query: qParams });
navigate("/resource/board", { query: qParams });
const appliedFilters = formatFilter(qParams);

const refreshList = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Resource/ResourceBoardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function BoardView() {
const { t } = useTranslation();

const onListViewBtnClick = () => {
navigate("/resource/list-view", { query: qParams });
navigate("/resource/list", { query: qParams });
localStorage.setItem("defaultResourceView", "list");
};

Expand Down
2 changes: 1 addition & 1 deletion src/Components/Resource/ResourceDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export default function ResourceDetails(props: { id: string }) {
<Page
title={"Resource details"}
crumbsReplacements={{ [props.id]: { name: data.title } }}
backUrl={"/resource/board-view"}
backUrl={"/resource/board"}
>
{isPrintMode ? (
<div className="my-4">
Expand Down
4 changes: 1 addition & 3 deletions src/Components/Shifting/BoardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ export default function BoardView() {
<div className="flex w-full flex-col gap-2 lg:mr-4 lg:w-fit lg:flex-row lg:gap-4">
<ButtonV2
className="py-[11px]"
onClick={() =>
navigate("/shifting/list-view", { query: qParams })
}
onClick={() => navigate("/shifting/list", { query: qParams })}
>
<CareIcon className="care-l-list-ul" />
{t("list_view")}
Expand Down
4 changes: 1 addition & 3 deletions src/Components/Shifting/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,7 @@ export default function ListView() {
<div className="flex w-full flex-col gap-2 lg:w-fit lg:flex-row lg:gap-4">
<ButtonV2
className="py-[11px]"
onClick={() =>
navigate("/shifting/board-view", { query: qParams })
}
onClick={() => navigate("/shifting/board", { query: qParams })}
>
<CareIcon className="care-l-list-ul rotate-90" />
{t("board_view")}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Shifting/ShiftDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ export default function ShiftDetails(props: { id: string }) {
) : (
<Page
title={t("shifting_details")}
backUrl="/shifting/board-view"
backUrl="/shifting/board"
options={
<div className="flex gap-2">
<ButtonV2
Expand Down
2 changes: 1 addition & 1 deletion src/Redux/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ export const sampleReport = (id: string, sampleId: string) => {
export const getTestList = (params: object) => {
return fireRequest("getTestSampleList", [], params);
};
export const getTestSample = (id: number) => {
export const getTestSample = (id: string) => {
return fireRequest("getTestSample", [id], {});
};
export const patchSample = (params: object, pathParam: object) => {
Expand Down
Loading

0 comments on commit fa49d0d

Please sign in to comment.