cập nhật modal add/edit fishingLog và sửa lỗi event ở map

This commit is contained in:
Tran Anh Tuan
2025-11-07 18:54:44 +07:00
parent c02b61163d
commit 4d821646cf
10 changed files with 300 additions and 213 deletions

View File

@@ -94,7 +94,7 @@ const ButtonCreateNewHaulOrTrip: React.FC<StartButtonProps> = ({
});
if (resp.status === 200) {
showSuccessToast("Bắt đầu chuyến đi thành công!");
getTrip();
await getTrip();
}
} catch (error) {
console.error("Error stating trip :", error);
@@ -125,7 +125,7 @@ const ButtonCreateNewHaulOrTrip: React.FC<StartButtonProps> = ({
const resp = await queryStartNewHaul(body);
if (resp.status === 200) {
showSuccessToast("Bắt đầu mẻ lưới mới thành công!");
getTrip();
await getTrip();
} else {
showErrorToast("Tạo mẻ lưới mới thất bại!");
}
@@ -173,7 +173,8 @@ const ButtonCreateNewHaulOrTrip: React.FC<StartButtonProps> = ({
</IconButton>
)}
<CreateOrUpdateHaulModal
haulData={null}
fishingLog={trip?.fishing_logs?.find((f) => f.status === 0)!}
fishingLogIndex={trip?.fishing_logs?.length!}
isVisible={isFinishHaulModalOpen}
onClose={function (): void {
setIsFinishHaulModalOpen(false);