mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 15:25:46 +00:00
Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/create-pdf-component
This commit is contained in:
@@ -49,6 +49,8 @@ const TransferToLayingFormModal = () => {
|
|||||||
const modalAction = searchParams.get('action');
|
const modalAction = searchParams.get('action');
|
||||||
const transferToLayingId = searchParams.get('id');
|
const transferToLayingId = searchParams.get('id');
|
||||||
|
|
||||||
|
const isModalActionForForm = modalAction === 'add' || modalAction === 'edit';
|
||||||
|
|
||||||
const { mutate } = useSWRConfig();
|
const { mutate } = useSWRConfig();
|
||||||
|
|
||||||
const refreshTransferToLayings = () => {
|
const refreshTransferToLayings = () => {
|
||||||
@@ -60,7 +62,7 @@ const TransferToLayingFormModal = () => {
|
|||||||
|
|
||||||
const { data: transferToLaying, isLoading: isLoadingTransferToLaying } =
|
const { data: transferToLaying, isLoading: isLoadingTransferToLaying } =
|
||||||
useSWR(
|
useSWR(
|
||||||
transferToLayingId
|
isModalActionForForm && transferToLayingId
|
||||||
? ['detail-transfer-to-laying', transferToLayingId]
|
? ['detail-transfer-to-laying', transferToLayingId]
|
||||||
: undefined,
|
: undefined,
|
||||||
([, id]) => TransferToLayingApi.getSingle(Number(id))
|
([, id]) => TransferToLayingApi.getSingle(Number(id))
|
||||||
|
|||||||
@@ -486,21 +486,19 @@ export function DailyChecklistContent() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Insert new phase links
|
// Insert new phase links
|
||||||
if (tempSelectedPhaseIds.length > 0) {
|
const setDailyChecklistPhaseRes =
|
||||||
const setDailyChecklistPhaseRes =
|
await DailyChecklistApi.setDailyChecklistPhase(
|
||||||
await DailyChecklistApi.setDailyChecklistPhase(
|
dailyChecklistId,
|
||||||
dailyChecklistId,
|
tempSelectedPhaseIds
|
||||||
tempSelectedPhaseIds
|
);
|
||||||
);
|
|
||||||
|
|
||||||
if (isResponseError(setDailyChecklistPhaseRes)) {
|
if (isResponseError(setDailyChecklistPhaseRes)) {
|
||||||
console.error(
|
console.error(
|
||||||
'Error saving phases:',
|
'Error saving phases:',
|
||||||
setDailyChecklistPhaseRes.message
|
setDailyChecklistPhaseRes.message
|
||||||
);
|
);
|
||||||
toast.error('Gagal menyimpan fase');
|
toast.error('Gagal menyimpan fase');
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setSelectedPhaseIds([...tempSelectedPhaseIds]);
|
setSelectedPhaseIds([...tempSelectedPhaseIds]);
|
||||||
|
|||||||
Reference in New Issue
Block a user