refactor(FE): Use nonstock_id and make select clearable

This commit is contained in:
rstubryan
2026-01-17 21:43:49 +07:00
parent ccf535cbd9
commit b66054c9a2
@@ -100,7 +100,7 @@ const ExpenseRequestKandangDetailExpense: React.FC<
};
const isExpenseRepeaterInputError = (
column: 'nonstock' | 'quantity' | 'price' | 'notes',
column: 'nonstock_id' | 'quantity' | 'price' | 'notes',
kandangExpenseIdx: number,
expenseIdx: number
) => {
@@ -125,7 +125,7 @@ const ExpenseRequestKandangDetailExpense: React.FC<
};
const getExpenseRepeaterErrorMessage = (
column: 'nonstock' | 'quantity' | 'price' | 'notes',
column: 'nonstock_id' | 'quantity' | 'price' | 'notes',
kandangExpenseIdx: number,
expenseIdx: number
): string => {
@@ -236,12 +236,12 @@ const ExpenseRequestKandangDetailExpense: React.FC<
);
}}
isError={isExpenseRepeaterInputError(
'nonstock',
'nonstock_id',
kandangExpenseIdx,
expenseIdx
)}
errorMessage={getExpenseRepeaterErrorMessage(
'nonstock',
'nonstock_id',
kandangExpenseIdx,
expenseIdx
)}
@@ -249,6 +249,7 @@ const ExpenseRequestKandangDetailExpense: React.FC<
isLoading={isLoadingNonstockOptions}
onInputChange={setNonstockInputValue}
className={{ wrapper: 'min-w-48' }}
isClearable={true}
/>
</td>