mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 07:45:47 +00:00
refactor(FE-170,174): clean up grading redirect in RecordingTable action
This commit is contained in:
@@ -27,7 +27,6 @@ import { useTableFilter } from '@/services/hooks/useTableFilter';
|
|||||||
import toast from 'react-hot-toast';
|
import toast from 'react-hot-toast';
|
||||||
import Badge from '@/components/Badge';
|
import Badge from '@/components/Badge';
|
||||||
import CheckboxInput from '@/components/input/CheckboxInput';
|
import CheckboxInput from '@/components/input/CheckboxInput';
|
||||||
import TextArea from '@/components/input/TextArea';
|
|
||||||
import { BaseApproval, BaseApiResponse } from '@/types/api/api-general';
|
import { BaseApproval, BaseApiResponse } from '@/types/api/api-general';
|
||||||
|
|
||||||
const RowOptionsMenu = ({
|
const RowOptionsMenu = ({
|
||||||
@@ -79,17 +78,6 @@ const RowOptionsMenu = ({
|
|||||||
<Icon icon='mdi:pencil-outline' width={16} height={16} />
|
<Icon icon='mdi:pencil-outline' width={16} height={16} />
|
||||||
Edit
|
Edit
|
||||||
</Button>
|
</Button>
|
||||||
{isLayingCategory && !isGradingDone && (
|
|
||||||
<Button
|
|
||||||
variant='ghost'
|
|
||||||
color='info'
|
|
||||||
className={`justify-start text-sm`}
|
|
||||||
href={`/production/recording/grading/add?recording_id=${props.row.original.id}`}
|
|
||||||
>
|
|
||||||
<Icon icon='material-symbols:egg' width={16} height={16} />
|
|
||||||
Grading
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
{!isApproved && !(isLayingCategory && !isGradingDone) && (
|
{!isApproved && !(isLayingCategory && !isGradingDone) && (
|
||||||
<Button
|
<Button
|
||||||
onClick={approveClickHandler}
|
onClick={approveClickHandler}
|
||||||
@@ -467,10 +455,7 @@ const RecordingTable = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const approveResponse = await RecordingApi.approve(
|
const approveResponse = await RecordingApi.approve(eligibleRowIds, notes);
|
||||||
eligibleRowIds,
|
|
||||||
notes
|
|
||||||
);
|
|
||||||
|
|
||||||
if (isResponseSuccess(approveResponse)) {
|
if (isResponseSuccess(approveResponse)) {
|
||||||
toast.success(
|
toast.success(
|
||||||
@@ -500,10 +485,7 @@ const RecordingTable = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const rejectResponse = await RecordingApi.reject(
|
const rejectResponse = await RecordingApi.reject(eligibleRowIds, notes);
|
||||||
eligibleRowIds,
|
|
||||||
notes
|
|
||||||
);
|
|
||||||
|
|
||||||
if (isResponseSuccess(rejectResponse)) {
|
if (isResponseSuccess(rejectResponse)) {
|
||||||
toast.success(`Berhasil reject ${eligibleRowIds.length} data recording!`);
|
toast.success(`Berhasil reject ${eligibleRowIds.length} data recording!`);
|
||||||
|
|||||||
Reference in New Issue
Block a user