mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 05:22:02 +00:00
Merge branch 'development' into 'production'
Development See merge request mbugroup/lti-web-client!356
This commit is contained in:
@@ -603,10 +603,11 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
|
||||
const {
|
||||
options: stockProductOptions,
|
||||
setInputValue: setStockProductInputValue,
|
||||
rawData: stockProducts,
|
||||
isLoadingOptions: isLoadingStockProducts,
|
||||
loadMore: loadMoreStockProducts,
|
||||
} = useSelect(ProductWarehouseApi.basePath, 'id', 'product.name', '', {
|
||||
} = useSelect(ProductWarehouseApi.basePath, 'id', 'product.name', 'search', {
|
||||
flags: 'PAKAN,OVK',
|
||||
location_id: stockProductsLocationId,
|
||||
kandang_id: stockProductsKandangId,
|
||||
@@ -2665,6 +2666,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
product.value === stock.product_warehouse_id
|
||||
) || null
|
||||
}
|
||||
onInputChange={setStockProductInputValue}
|
||||
onChange={(selectedOption) => {
|
||||
const option =
|
||||
selectedOption as OptionType | null;
|
||||
|
||||
@@ -136,7 +136,7 @@ export function ListDailyChecklistContent() {
|
||||
|
||||
const handleEdit = (item: DailyChecklist) => {
|
||||
const formattedDate = new Date(item.date).toISOString().split('T')[0];
|
||||
const kandangId = item.kandang.id;
|
||||
const kandangId = item.kandang?.id ?? '';
|
||||
const category = item.category;
|
||||
|
||||
router.push(
|
||||
@@ -335,7 +335,7 @@ export function ListDailyChecklistContent() {
|
||||
accessorKey: 'kandang',
|
||||
header: 'Kandang',
|
||||
enableSorting: false,
|
||||
cell: ({ row }) => row.original.kandang.name,
|
||||
cell: ({ row }) => row.original.kandang?.name ?? '-',
|
||||
},
|
||||
{
|
||||
accessorKey: 'category',
|
||||
@@ -627,7 +627,7 @@ export function ListDailyChecklistContent() {
|
||||
<div className='flex justify-between text-sm'>
|
||||
<span className='text-gray-600'>Kandang:</span>
|
||||
<span className='font-medium text-gray-900'>
|
||||
{selectedItem.kandang.name}
|
||||
{selectedItem.kandang?.name ?? '-'}
|
||||
</span>
|
||||
</div>
|
||||
<div className='flex justify-between text-sm'>
|
||||
@@ -687,7 +687,7 @@ export function ListDailyChecklistContent() {
|
||||
<div className='flex justify-between text-sm'>
|
||||
<span className='text-gray-600'>Kandang:</span>
|
||||
<span className='font-medium text-gray-900'>
|
||||
{selectedItem.kandang.name}
|
||||
{selectedItem.kandang?.name ?? '-'}
|
||||
</span>
|
||||
</div>
|
||||
<div className='flex justify-between text-sm'>
|
||||
@@ -760,7 +760,7 @@ export function ListDailyChecklistContent() {
|
||||
<div className='flex justify-between text-sm'>
|
||||
<span className='text-gray-600'>Kandang:</span>
|
||||
<span className='font-medium text-gray-900'>
|
||||
{selectedItem.kandang.name}
|
||||
{selectedItem.kandang?.name ?? '-'}
|
||||
</span>
|
||||
</div>
|
||||
<div className='flex justify-between text-sm'>
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ export function DetailDailyChecklistContent() {
|
||||
const checklistData = {
|
||||
id: rawDetailChecklist?.id,
|
||||
date: rawDetailChecklist?.date,
|
||||
kandang_id: rawDetailChecklist?.kandang.id,
|
||||
kandang_id: rawDetailChecklist?.kandang?.id,
|
||||
category: rawDetailChecklist?.category,
|
||||
status: rawDetailChecklist?.status,
|
||||
reject_reason: rawDetailChecklist?.reject_reason,
|
||||
|
||||
@@ -10,7 +10,10 @@ const axiosClient = axios.create({ baseURL: BASE_URL, timeout: 10_000 });
|
||||
axiosClient.interceptors.response.use(
|
||||
(response) => response,
|
||||
(error: AxiosError) => {
|
||||
if (error.response?.status === 401) {
|
||||
if (
|
||||
error.response?.status === 401 &&
|
||||
error.config?.url !== '/sso/refresh'
|
||||
) {
|
||||
redirectToSSO();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ export type BaseDailyChecklist = {
|
||||
status: string;
|
||||
category: string;
|
||||
date: string;
|
||||
kandang: Pick<BaseKandang, 'id' | 'name' | 'status' | 'capacity'>;
|
||||
kandang?: Pick<BaseKandang, 'id' | 'name' | 'status' | 'capacity'>;
|
||||
total_phase: number;
|
||||
total_activity: number;
|
||||
progress: number;
|
||||
|
||||
Reference in New Issue
Block a user