mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
feat(FE-170,175): enhance product fetching in RecordingForm with additional filters and limits
This commit is contained in:
@@ -211,6 +211,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
const params = new URLSearchParams({
|
||||
flags: 'PAKAN,OVK',
|
||||
search: '',
|
||||
limit: '100',
|
||||
location_id: selectedLocation.value.toString(),
|
||||
});
|
||||
return `${ProductWarehouseApi.basePath}?${params.toString()}`;
|
||||
@@ -220,6 +221,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
if (!selectedLocation) return null;
|
||||
const params = new URLSearchParams({
|
||||
search: '',
|
||||
limit: '100',
|
||||
location_id: selectedLocation.value.toString(),
|
||||
});
|
||||
return `${ProductWarehouseApi.basePath}?${params.toString()}`;
|
||||
@@ -244,10 +246,9 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
useSWR(depletionProductsUrl, ProductWarehouseApi.getAllFetcher);
|
||||
|
||||
const eggProductsUrl = useMemo(() => {
|
||||
if (!selectedLocation) return null;
|
||||
const params = new URLSearchParams({
|
||||
search: '',
|
||||
location_id: selectedLocation.value.toString(),
|
||||
search: 'telur',
|
||||
limit: '100',
|
||||
});
|
||||
return `${ProductWarehouseApi.basePath}?${params.toString()}`;
|
||||
}, [selectedLocation]);
|
||||
@@ -462,7 +463,10 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
|
||||
if (
|
||||
productName.toLowerCase().includes('telur') ||
|
||||
productName.toLowerCase().includes('egg')
|
||||
productName.toLowerCase().includes('egg') ||
|
||||
productName.toLowerCase().includes('pecah') ||
|
||||
productName.toLowerCase().includes('konsumsi') ||
|
||||
productName.toLowerCase().includes('baik')
|
||||
) {
|
||||
options.push({
|
||||
value: product.id,
|
||||
|
||||
Reference in New Issue
Block a user