mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 07:15:44 +00:00
refactor(FE-208,212): rename getPurchaseItemError to isRepeaterInputError for clarity in validation checks
This commit is contained in:
@@ -72,7 +72,7 @@ const PurchaseRequestForm = ({
|
||||
}
|
||||
|
||||
// ===== UTILITY FUNCTIONS =====
|
||||
const getPurchaseItemError = (
|
||||
const isRepeaterInputError = (
|
||||
idx: number,
|
||||
field: 'product_warehouse_id' | 'product_id' | 'qty'
|
||||
): { isError: boolean; errorMessage: string } => {
|
||||
@@ -784,11 +784,11 @@ const PurchaseRequestForm = ({
|
||||
options={getProductWarehouseOptionsForItem()}
|
||||
isLoading={isLoadingProductWarehouses}
|
||||
isError={
|
||||
getPurchaseItemError(idx, 'product_warehouse_id')
|
||||
isRepeaterInputError(idx, 'product_warehouse_id')
|
||||
.isError
|
||||
}
|
||||
errorMessage={
|
||||
getPurchaseItemError(idx, 'product_warehouse_id')
|
||||
isRepeaterInputError(idx, 'product_warehouse_id')
|
||||
.errorMessage
|
||||
}
|
||||
isDisabled={
|
||||
@@ -820,9 +820,9 @@ const PurchaseRequestForm = ({
|
||||
readOnly={type === 'detail'}
|
||||
allowNegative={false}
|
||||
decimalScale={0}
|
||||
isError={getPurchaseItemError(idx, 'qty').isError}
|
||||
isError={isRepeaterInputError(idx, 'qty').isError}
|
||||
errorMessage={
|
||||
getPurchaseItemError(idx, 'qty').errorMessage
|
||||
isRepeaterInputError(idx, 'qty').errorMessage
|
||||
}
|
||||
className={{
|
||||
wrapper: 'min-w-24',
|
||||
|
||||
Reference in New Issue
Block a user