Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

refactor: approval requests routes, table, history, sttatus

Ayush Soni39315eadb90d
diff --git a/apps/erp/app/modules/approvals/ui/ApprovalDecisionModal.tsx b/apps/erp/app/modules/approvals/ui/ApprovalDecisionModal.tsx
deleted file mode 100644
index a020d2813c..0000000000
--- a/apps/erp/app/modules/approvals/ui/ApprovalDecisionModal.tsx
+++ /dev/null
@@ -1,133 +0,0 @@
-import {
- Button,
- HStack,
- Modal,
- ModalBody,
- ModalClose,
- ModalContent,
- ModalDescription,
- ModalFooter,
- ModalHeader,
- ModalTitle,
- Textarea,
- VStack
-} from "@carbon/react";
-import { useEffect, useState } from "react";
-import { useFetcher, useRevalidator } from "react-router";
-import type { ApprovalRequest } from "~/modules/approvals";
-import { path } from "~/utils/path";
-
-type ApprovalDecisionModalProps = {
- approval: ApprovalRequest;
- decisionType: "approve" | "reject";
- isOpen: boolean;
- onClose: () => void;
-};
-
-const ApprovalDecisionModal = ({
- approval,
- decisionType,
- isOpen,
- onClose
-}: ApprovalDecisionModalProps) => {
- const fetcher = useFetcher();
- const revalidator = useRevalidator();
- const [notes, setNotes] = useState("");
-
- const isApproving = decisionType === "approve";
- const isSubmitting = fetcher.state !== "idle";
-
- // Close modal and refresh on successful submission
- useEffect(() => {
- if (fetcher.state === "idle" && fetcher.data) {
- // Check if the response indicates success
- if (fetcher.data.success) {
- onClose();
- // Revalidate the data to refresh the table
- revalidator.revalidate();
- }
- // If there's a validation error (fieldErrors), it will be handled by the form
- // If there's an error message, we should show it (but the modal will stay open)
- }
- }, [fetcher.state, fetcher.data, onClose, revalidator]);
-
- const handleSubmit = () => {
- if (!approval.id) {
- console.error("Approval ID is missing");
- return;
- }
-
- const formData = new FormData();
- formData.append("id", approval.id);
- formData.append("decision", isApproving ? "Approved" : "Rejected");
- if (notes) {
- formData.append("decisionNotes", notes);
- }
-
- fetcher.submit(formData, {
- method: "post",
- action: path.to.approvalDecision(approval.id)
- });
- };
-
- return (
- <Modal
- open={isOpen}
- onOpenChange={(open) => !open && !isSubmitting && onClose()}
- >
- <ModalContent>
- <ModalHeader>
- <ModalTitle>
- {isApproving ? "Approve Request" : "Reject Request"}
- </ModalTitle>
- <ModalDescription>
- {isApproving
- ? `Are you sure you want to approve ${approval.documentReadableId ?? approval.documentId}?`
- : `Are you sure you want to reject ${approval.documentReadableId ?? approval.documentId}?`}
- </ModalDescription>
- <ModalClose onClick={onClose} disabled={isSubmitting} />
- </ModalHeader>
- <ModalBody>
- <VStack spacing={4}>
- <div className="w-full">
- <label
- htmlFor="decisionNotes"
- className="text-sm font-medium text-muted-foreground mb-2 block"
- >
- Notes (optional)
- </label>
- <Textarea
- id="decisionNotes"
- value={notes}
- onChange={(e) => setNotes(e.target.value)}
- placeholder="Add any notes about your decision..."
- rows={4}
- disabled={isSubmitting}
- />
- </div>
- </VStack>
- </ModalBody>
- <ModalFooter>
- <HStack spacing={2}>
- <Button
- variant="secondary"
- onClick={onClose}
- disabled={isSubmitting}
- >
- Cancel
- </Button>
- <Button
- variant={isApproving ? "primary" : "destructive"}
- onClick={handleSubmit}
- isLoading={isSubmitting}
- >
- {isApproving ? "Approve" : "Reject"}
- </Button>
- </HStack>
- </ModalFooter>
- </ModalContent>
- </Modal>
- );
-};
-
-export default ApprovalDecisionModal;
diff --git a/apps/erp/app/modules/approvals/ui/ApprovalHistory.tsx b/apps/erp/app/modules/approvals/ui/ApprovalHistory.tsx
deleted file mode 100644
index 31fc97026a..0000000000
--- a/apps/erp/app/modules/approvals/ui/ApprovalHistory.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-import {
- Card,
- CardContent,
- CardHeader,
- CardTitle,
- VStack
-} from "@carbon/react";
-import { formatDate } from "@carbon/utils";
-import { EmployeeAvatar } from "~/components";
-import type { ApprovalHistory as ApprovalHistoryType } from "~/modules/approvals";
-import ApprovalStatus from "./ApprovalStatus";
-
-type ApprovalHistoryProps = {
- history: ApprovalHistoryType;
-};
-
-const ApprovalHistory = ({ history }: ApprovalHistoryProps) => {
- if (!history || history.length === 0) {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Approval History</CardTitle>
- </CardHeader>
- <CardContent>
- <p className="text-muted-foreground text-sm">No approval history</p>
- </CardContent>
- </Card>
- );
- }
-
- return (
- <Card>
- <CardHeader>
- <CardTitle>Approval History</CardTitle>
- </CardHeader>
- <CardContent>
- <VStack spacing={4} className="w-full">
- {history.map((item) => (
- <div key={item.id} className="border rounded-lg p-4 space-y-2">
- <div className="flex items-center justify-between">
- <ApprovalStatus status={item.status} />
- <span className="text-sm text-muted-foreground">
- {formatDate(item.requestedAt)}
- </span>
- </div>
- <div className="flex items-center gap-2">
- <span className="text-sm text-muted-foreground">
- Requested by:
- </span>
- <EmployeeAvatar employeeId={item.requestedBy} />
- </div>
- {item.decisionBy && (
- <div className="flex items-center gap-2">
- <span className="text-sm text-muted-foreground">
- Decision by:
- </span>
- <EmployeeAvatar employeeId={item.decisionBy} />
- <span className="text-sm text-muted-foreground">
- on {formatDate(item.decisionAt)}
- </span>
- </div>
- )}
- {item.decisionNotes && (
- <div className="text-sm">
- <span className="text-muted-foreground">Notes: </span>
- {item.decisionNotes}
- </div>
- )}
- </div>
- ))}
- </VStack>
- </CardContent>
- </Card>
- );
-};
-
-export default ApprovalHistory;
diff --git a/apps/erp/app/modules/approvals/ui/ApprovalRules.tsx b/apps/erp/app/modules/approvals/ui/ApprovalRules.tsx
index 9de796fa17..4b0f62bc23 100644
--- a/apps/erp/app/modules/approvals/ui/ApprovalRules.tsx
+++ b/apps/erp/app/modules/approvals/ui/ApprovalRules.tsx
@@ -10,7 +10,7 @@ import {
VStack
} from "@carbon/react";
import { memo } from "react";
-import { LuInbox, LuPlus } from "react-icons/lu";
+import { LuPlus } from "react-icons/lu";
import { Link } from "react-router";
import { Empty } from "~/components";
import { usePermissions } from "~/hooks";
@@ -34,13 +34,7 @@ const ApprovalRules = memo(({ poRules, qdRules }: ApprovalRulesProps) => {
<ScrollArea className="h-full w-full">
<div className="py-12 px-4 max-w-[60rem] mx-auto">
<div className="mb-8">
- <div className="flex items-center justify-between mb-4">
- <Heading size="h2">Approval Rules</Heading>
- {/* TODO: View Requests button - remove soon */}
- <Button variant="secondary" leftIcon={<LuInbox />} asChild>
- <Link to={path.to.approvalRequests}>View Requests</Link>
- </Button>
- </div>
+ <Heading size="h2">Approval Rules</Heading>
</div>
<Card className="mb-6">
diff --git a/apps/erp/app/modules/approvals/ui/ApprovalStatus.tsx b/apps/erp/app/modules/approvals/ui/ApprovalStatus.tsx
deleted file mode 100644
index 3a1952ee54..0000000000
--- a/apps/erp/app/modules/approvals/ui/ApprovalStatus.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Status } from "@carbon/react";
-import type { approvalStatusType } from "../approvals.models";
-
-type ApprovalStatusProps = {
- status: (typeof approvalStatusType)[number] | null;
-};
-
-const ApprovalStatus = ({ status }: ApprovalStatusProps) => {
- switch (status) {
- case "Pending":
- return <Status color="orange">Pending</Status>;
- case "Approved":
- return <Status color="green">Approved</Status>;
- case "Rejected":
- return <Status color="red">Rejected</Status>;
- case "Cancelled":
- return <Status color="gray">Cancelled</Status>;
- default:
- return null;
- }
-};
-
-export default ApprovalStatus;
diff --git a/apps/erp/app/modules/approvals/ui/ApprovalsTable.tsx b/apps/erp/app/modules/approvals/ui/ApprovalsTable.tsx
deleted file mode 100644
index 26c52eaefe..0000000000
--- a/apps/erp/app/modules/approvals/ui/ApprovalsTable.tsx
+++ /dev/null
@@ -1,272 +0,0 @@
-import {
- Badge,
- HStack,
- MenuIcon,
- MenuItem,
- useDisclosure
-} from "@carbon/react";
-import { formatDate } from "@carbon/utils";
-import type { ColumnDef } from "@tanstack/react-table";
-import { memo, useCallback, useMemo, useState } from "react";
-import {
- LuCalendar,
- LuCheck,
- LuFileText,
- LuStar,
- LuUser,
- LuX
-} from "react-icons/lu";
-import { EmployeeAvatar, Hyperlink, Table } from "~/components";
-import type { ApprovalRequest } from "~/modules/approvals";
-import { approvalDocumentType, approvalStatusType } from "~/modules/approvals";
-import { usePeople } from "~/stores";
-import { path } from "~/utils/path";
-import ApprovalDecisionModal from "./ApprovalDecisionModal";
-import ApprovalStatus from "./ApprovalStatus";
-
-type ApprovalsTableProps = {
- data: ApprovalRequest[];
- count: number;
-};
-
-const ApprovalsTable = memo(({ data, count }: ApprovalsTableProps) => {
- const [people] = usePeople();
-
- const [selectedApproval, setSelectedApproval] =
- useState<ApprovalRequest | null>(null);
- const [decisionType, setDecisionType] = useState<"approve" | "reject">(
- "approve"
- );
-
- const decisionModal = useDisclosure();
-
- const columns = useMemo<ColumnDef<ApprovalRequest>[]>(() => {
- const defaultColumns: ColumnDef<ApprovalRequest>[] = [
- {
- accessorKey: "documentReadableId",
- header: "Document",
- cell: ({ row }) => {
- const docType = row.original.documentType;
- const docId = row.original.documentId;
- const readableId = row.original.documentReadableId;
- const label = readableId ?? docId ?? "—";
-
- if (!docId) {
- return (
- <HStack>
- <span>{label}</span>
- </HStack>
- );
- }
-
- let link: string | null = null;
- if (docType === "purchaseOrder") {
- link = path.to.purchaseOrderDetails(docId);
- } else if (docType === "qualityDocument") {
- link = path.to.qualityDocument(docId);
- }
-
- if (!link) {
- return (
- <HStack>
- <span>{label}</span>
- </HStack>
- );
- }
-
- return (
- <HStack>
- <Hyperlink to={link}>{label}</Hyperlink>
- </HStack>
- );
- },
- meta: {
- icon: <LuFileText />
- }
- },
- {
- accessorKey: "documentType",
- header: "Type",
- cell: ({ row }) => {
- const type = row.original.documentType;
- return (
- <Badge variant="secondary">
- {type === "purchaseOrder" ? "Purchase Order" : "Quality Document"}
- </Badge>
- );
- },
- meta: {
- filter: {
- type: "static",
- options: approvalDocumentType.map((type) => ({
- value: type,
- label:
- type === "purchaseOrder" ? "Purchase Order" : "Quality Document"
- }))
- },
- pluralHeader: "Document Types",
- icon: <LuFileText />
- }
- },
- {
- accessorKey: "documentDescription",
- header: "Description",
- cell: (item) => item.getValue(),
- meta: {
- icon: <LuFileText />
- }
- },
- {
- accessorKey: "status",
- header: "Status",
- cell: ({ row }) => {
- return <ApprovalStatus status={row.original.status} />;
- },
- meta: {
- filter: {
- type: "static",
- options: approvalStatusType.map((status) => ({
- value: status,
- label: <ApprovalStatus status={status} />
- }))
- },
- pluralHeader: "Statuses",
- icon: <LuStar />
- }
- },
- {
- id: "requestedByName",
- header: "Requested By",
- cell: ({ row }) => (
- <EmployeeAvatar employeeId={row.original.requestedBy} />
- ),
- meta: {
- filter: {
- type: "static",
- options: people.map((employee) => ({
- value: employee.id,
- label: employee.name
- }))
- },
- icon: <LuUser />
- }
- },
- {
- accessorKey: "requestedAt",
- header: "Requested Date",
- cell: (item) => formatDate(item.getValue<string>()),
- meta: {
- icon: <LuCalendar />
- }
- },
- {
- id: "approverName",
- header: "Approver",
- cell: ({ row }) => {
- if (row.original.approverId) {
- return <EmployeeAvatar employeeId={row.original.approverId} />;
- }
- return null;
- },
- meta: {
- icon: <LuUser />
- }
- },
- {
- accessorKey: "decisionAt",
- header: "Decision Date",
- cell: (item) => formatDate(item.getValue<string>()),
- meta: {
- icon: <LuCalendar />
- }
- },
- {
- id: "decisionByName",
- header: "Decided By",
- cell: ({ row }) => (
- <EmployeeAvatar employeeId={row.original.decisionBy} />
- ),
- meta: {
- icon: <LuUser />
- }
- },
- {
- accessorKey: "decisionNotes",
- header: "Notes",
- cell: (item) => item.getValue(),
- meta: {
- icon: <LuFileText />
- }
- }
- ];
-
- return defaultColumns;
- }, [people]);
-
- const renderContextMenu = useCallback(
- (row: ApprovalRequest) => (
- <>
- <MenuItem
- disabled={row.status !== "Pending"}
- onClick={() => {
- setSelectedApproval(row);
- setDecisionType("approve");
- decisionModal.onOpen();
- }}
- >
- <MenuIcon icon={<LuCheck />} />
- Approve
- </MenuItem>
- <MenuItem
- disabled={row.status !== "Pending"}
- onClick={() => {
- setSelectedApproval(row);
- setDecisionType("reject");
- decisionModal.onOpen();
- }}
- >
- <MenuIcon icon={<LuX />} />
- Reject
- </MenuItem>
- </>
- ),
- [decisionModal]
- );
-
- return (
- <>
- <Table<ApprovalRequest>
- count={count}
- columns={columns}
- data={data}
- defaultColumnPinning={{
- left: ["documentReadableId"]
- }}
- defaultColumnVisibility={{
- decisionNotes: false,
- decisionAt: false,
- decisionByName: false
- }}
- renderContextMenu={renderContextMenu}
- title="Approvals Requests"
- table="approvalRequest"
- withSavedView
- />
-
- {selectedApproval?.id && (
- <ApprovalDecisionModal
- approval={selectedApproval}
- decisionType={decisionType}
- isOpen={decisionModal.isOpen}
- onClose={() => {
- decisionModal.onClose();
- setSelectedApproval(null);
- }}
- />
- )}
- </>
- );
-});
-ApprovalsTable.displayName = "ApprovalsTable";
-
-export default ApprovalsTable;
diff --git a/apps/erp/app/modules/approvals/ui/index.ts b/apps/erp/app/modules/approvals/ui/index.ts
index 36b6c5b799..55c6864695 100644
--- a/apps/erp/app/modules/approvals/ui/index.ts
+++ b/apps/erp/app/modules/approvals/ui/index.ts
@@ -1,6 +1 @@
-export { default as ApprovalDecisionModal } from "./ApprovalDecisionModal";
-export { default as ApprovalHistory } from "./ApprovalHistory";
export { default as ApprovalRuleForm } from "./ApprovalRuleForm";
-
-export { default as ApprovalStatus } from "./ApprovalStatus";
-export { default as ApprovalsTable } from "./ApprovalsTable";
diff --git a/apps/erp/app/routes/x+/settings+/approvals+/_layout.tsx b/apps/erp/app/routes/x+/settings+/approvals+/_layout.tsx
deleted file mode 100644
index 31f1bb5c02..0000000000
--- a/apps/erp/app/routes/x+/settings+/approvals+/_layout.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Outlet } from "react-router";
-import type { Handle } from "~/utils/handle";
-import { path } from "~/utils/path";
-
-export const handle: Handle = {
- breadcrumb: "Approvals",
- to: path.to.approvalRules
-};
-
-export default function ApprovalsLayout() {
- return <Outlet />;
-}
diff --git a/apps/erp/app/routes/x+/settings+/approvals+/requests.$id.tsx b/apps/erp/app/routes/x+/settings+/approvals+/requests.$id.tsx
deleted file mode 100644
index 3f3c8487bd..0000000000
--- a/apps/erp/app/routes/x+/settings+/approvals+/requests.$id.tsx
+++ /dev/null
@@ -1,193 +0,0 @@
-import { error, getCarbonServiceRole } from "@carbon/auth";
-import { requirePermissions } from "@carbon/auth/auth.server";
-import { flash } from "@carbon/auth/session.server";
-import { validationError, validator } from "@carbon/form";
-import { useEffect } from "react";
-import type { ActionFunctionArgs, LoaderFunctionArgs } from "react-router";
-import { redirect, useNavigate } from "react-router";
-import {
- approvalDecisionValidator,
- approveRequest,
- canApproveRequest,
- getApprovalById,
- rejectRequest
-} from "~/modules/approvals";
-import { path } from "~/utils/path";
-
-export async function loader({ request, params }: LoaderFunctionArgs) {
- const { userId } = await requirePermissions(request, {
- role: "employee"
- });
-
- const serviceRole = getCarbonServiceRole();
- const { id } = params;
- if (!id) throw new Error("id is not found");
-
- const approval = await getApprovalById(serviceRole, id);
- if (approval.error || !approval.data) {
- throw redirect(
- path.to.approvalRequests,
- await flash(
- request,
- error(
- approval.error ?? new Error("Approval request not found"),
- "Approval request not found"
- )
- )
- );
- }
-
- // Check if user can approve/reject this request
- const canApprove = await canApproveRequest(
- serviceRole,
- {
- amount: approval.data.amount,
- documentType: approval.data.documentType,
- companyId: approval.data.companyId
- },
- userId
- );
-
- if (!canApprove) {
- throw redirect(
- path.to.approvalRequests,
- await flash(
- request,
- error(
- new Error(
- "You do not have permission to approve/reject this request"
- ),
- "You do not have permission to approve or reject this request"
- )
- )
- );
- }
-
- if (approval.data.status !== "Pending") {
- throw redirect(
- path.to.approvalRequests,
- await flash(
- request,
- error(
- new Error("Approval request is not pending"),
- "Approval request is not pending"
- )
- )
- );
- }
-
- return { approval: approval.data };
-}
-
-export async function action({ request, params }: ActionFunctionArgs) {
- const { userId } = await requirePermissions(request, {
- role: "employee"
- });
-
- const serviceRole = getCarbonServiceRole();
- const { id } = params;
- if (!id) throw new Error("id is not found");
-
- const formData = await request.formData();
- const validation = await validator(approvalDecisionValidator).validate(
- formData
- );
-
- if (validation.error) {
- return validationError(validation.error);
- }
-
- const { decision, decisionNotes } = validation.data;
-
- // Get approval request and check permissions
- const approval = await getApprovalById(serviceRole, id);
- if (approval.error || !approval.data) {
- throw redirect(
- path.to.approvalRequests,
- await flash(
- request,
- error(
- approval.error ?? new Error("Approval request not found"),
- "Approval request not found"
- )
- )
- );
- }
-
- // Check if user can approve/reject this request
- const canApprove = await canApproveRequest(
- serviceRole,
- {
- amount: approval.data.amount,
- documentType: approval.data.documentType,
- companyId: approval.data.companyId
- },
- userId
- );
- if (!canApprove) {
- throw redirect(
- path.to.approvalRequests,
- await flash(
- request,
- error(
- new Error(
- "You do not have permission to approve/reject this request"
- ),
- "You do not have permission to approve or reject this request"
- )
- )
- );
- }
-
- if (approval.data.status !== "Pending") {
- throw redirect(
- path.to.approvalRequests,
- await flash(
- request,
- error(
- new Error("Approval request is not pending"),
- "Approval request is not pending"
- )
- )
- );
- }
-
- let result;
- if (decision === "Approved") {
- result = await approveRequest(serviceRole, id, userId, decisionNotes);
- } else {
- result = await rejectRequest(serviceRole, id, userId, decisionNotes);
- }
-
- if (result.error) {
- // Return JSON error for fetcher requests
- // Regular form submissions will be handled by the redirect below
- return Response.json(
- { error: result.error.message, success: false },
- { status: 400 }
- );
- }
-
- // Return JSON response for fetcher requests
- // The modal will handle the response and refresh the data
- return Response.json({
- success: true,
- message:
- decision === "Approved"
- ? "Approval request approved"
- : "Approval request rejected"
- });
-}
-
-export default function ApprovalDecisionRoute() {
- // This route is only used for the action handler (POST requests via fetcher)
- // If accessed directly via GET, redirect to the requests list
- // The modal in ApprovalsTable handles the UI
- const navigate = useNavigate();
-
- useEffect(() => {
- navigate(path.to.approvalRequests, { replace: true });
- }, [navigate]);
-
- return null;
-}
diff --git a/apps/erp/app/routes/x+/settings+/approvals+/requests.tsx b/apps/erp/app/routes/x+/settings+/approvals+/requests.tsx
deleted file mode 100644
index 719e7e4324..0000000000
--- a/apps/erp/app/routes/x+/settings+/approvals+/requests.tsx
+++ /dev/null
@@ -1,72 +0,0 @@
-import { error, getCarbonServiceRole } from "@carbon/auth";
-import { requirePermissions } from "@carbon/auth/auth.server";
-import { flash } from "@carbon/auth/session.server";
-import { VStack } from "@carbon/react";
-import type { LoaderFunctionArgs } from "react-router";
-import { Outlet, redirect, useLoaderData } from "react-router";
-import {
- type ApprovalDocumentType,
- type ApprovalStatus,
- getApprovalsForUser
-} from "~/modules/approvals";
-import { ApprovalsTable } from "~/modules/approvals/ui";
-import type { Handle } from "~/utils/handle";
-import { path } from "~/utils/path";
-import { getGenericQueryFilters } from "~/utils/query";
-
-export const handle: Handle = {
- breadcrumb: "Requests",
- to: path.to.approvalRequests
-};
-
-export async function loader({ request }: LoaderFunctionArgs) {
- const { companyId, userId } = await requirePermissions(request, {
- role: "employee"
- });
-
- const serviceRole = getCarbonServiceRole();
-
- const url = new URL(request.url);
- const searchParams = new URLSearchParams(url.search);
- const documentType = searchParams.get("documentType");
- const status = searchParams.get("status");
- const dateFrom = searchParams.get("dateFrom");
- const dateTo = searchParams.get("dateTo");
- const { limit, offset, sorts, filters } =
- getGenericQueryFilters(searchParams);
-
- const approvals = await getApprovalsForUser(serviceRole, userId, companyId, {
- documentType: documentType as ApprovalDocumentType,
- status: status as ApprovalStatus,
- dateFrom,
- dateTo,
- limit,
- offset,
- sorts,
- filters
- });
-
- if (approvals.error) {
- console.error(approvals.error);
- throw redirect(
- path.to.authenticatedRoot,
- await flash(request, error(approvals.error, "Error loading approvals"))
- );
- }
-
- return {
- approvals: approvals.data ?? [],
- count: approvals.count ?? 0
- };
-}
-
-export default function ApprovalRequestsRoute() {
- const { approvals, count } = useLoaderData<typeof loader>();
-
- return (
- <VStack spacing={0} className="h-full">
- <ApprovalsTable data={approvals} count={count} />
- <Outlet />
- </VStack>
- );
-}
diff --git a/apps/erp/app/utils/path.ts b/apps/erp/app/utils/path.ts
index 66e302d560..9d590897a8 100644
--- a/apps/erp/app/utils/path.ts
+++ b/apps/erp/app/utils/path.ts
@@ -362,13 +362,6 @@ export const path = {
},
authenticatedRoot: x,
acknowledge: `${x}/acknowledge`,
- approvalRequests: `${x}/settings/approvals/requests`,
- approvalDecision: (id: string) =>
- generatePath(`${x}/settings/approvals/requests/${id}`),
- approvalDecisionWithType: (id: string, decision: "approve" | "reject") =>
- generatePath(
- `${x}/settings/approvals/requests/${id}?decision=${decision}`
- ),
approvalRules: `${x}/settings/approval-rules`,
approvalRule: (id: string) =>
generatePath(`${x}/settings/approval-rules/${id}`),