feat(FE-170,175): add module_id prop to approval history modal in RecordingTable

This commit is contained in:
rstubryan
2025-11-06 19:13:11 +07:00
parent b39e8325f8
commit 5245d44a79
@@ -136,20 +136,28 @@ const ApprovalHistoryModal = ({
ref,
currentApproval,
module_name = 'RECORDINGS',
module_id,
}: {
ref: RefObject<HTMLDialogElement | null>;
currentApproval?: BaseApproval;
module_name?: string;
module_id?: number | undefined;
}) => {
const [isModalOpen, setIsModalOpen] = useState(false);
const approvalHistoryUrl = useMemo(() => {
if (!isModalOpen) return null;
return `${ApprovalApi.basePath}?${new URLSearchParams({
const params = new URLSearchParams({
module_name: module_name,
group_step_number: 'true',
}).toString()}`;
}, [module_name, isModalOpen]);
});
if (module_id) {
params.append('module_id', module_id.toString());
}
return `${ApprovalApi.basePath}?${params.toString()}`;
}, [module_name, module_id, isModalOpen]);
type GroupedApprovalResponse = {
step_number: number;
@@ -993,6 +1001,7 @@ const RecordingTable = () => {
ref={approvalHistoryModal.ref}
currentApproval={selectedRecording?.approval}
module_name={'RECORDINGS'}
module_id={selectedRecording?.id}
/>
</div>
);