Skip to content

Commit

Permalink
fix: filter issue with chips on CustomerParkScreen (#826)
Browse files Browse the repository at this point in the history
* RM#87640
  • Loading branch information
vhu-axelor authored and lme-axelor committed Dec 5, 2024
1 parent 0dfadd4 commit a375a14
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
5 changes: 5 additions & 0 deletions changelogs/unreleased/87640.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"title": "CustomerParkScreen: resolve filter issue with chips",
"type": "fix",
"packages": "intervention"
}
28 changes: 24 additions & 4 deletions packages/apps/intervention/src/api/equipment-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,29 @@ const createEquipmentsCriteria = ({

if (inService != null) {
criteria.push({
fieldName: 'inService',
operator: inService ? '=' : '!=',
value: true,
operator: 'or',
criteria: [
{
operator: 'and',
criteria: [
{
fieldName: 'typeSelect',
operator: '=',
value: Equipment?.typeSelect.Equipment,
},
{
fieldName: 'inService',
operator: inService ? '=' : '!=',
value: true,
},
],
},
{
fieldName: 'typeSelect',
operator: '=',
value: Equipment?.typeSelect.Place,
},
],
});
}

Expand Down Expand Up @@ -144,7 +164,7 @@ const createInterventionEquipmentToLinkCriteria = ({
export async function searchEquipment({
searchValue = null,
page = 0,
inService,
inService = null,
partnerId,
parentPlaceId,
noParent = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const CustomerParkScreen = ({}) => {
sliceFunctionDataNoParentName="noParent"
fetchBranchData={branchId =>
searchEquipmentApi({
inService: selectedStatus[0]?.key,
inService: selectedStatus[0]?.value,
partnerId: customer?.id,
parentPlaceId: branchId,
})
Expand Down

0 comments on commit a375a14

Please sign in to comment.