@@ -152,7 +152,6 @@ const actions: ActionTree<OrderState, RootState> = {
152
152
// getting all the orders from state
153
153
const cachedOrders = JSON . parse ( JSON . stringify ( state . completed . list ) ) ; // maintaining cachedOrders as to prepare the orders payload
154
154
let completedOrders = JSON . parse ( JSON . stringify ( state . completed . list ) ) ; // maintaining completedOrders as update the orders information once information in fetched
155
- const currentFacilityId = getCurrentFacilityId ( ) ;
156
155
157
156
// Split orders in batch of 40
158
157
const batchSize = 20 ;
@@ -173,7 +172,7 @@ const actions: ActionTree<OrderState, RootState> = {
173
172
}
174
173
175
174
try {
176
- const shipmentbatches = await Promise . all ( requestParams . map ( ( params ) => OrderService . fetchShipments ( params . picklistBinIds , params . orderIds , currentFacilityId ) ) )
175
+ const shipmentbatches = await Promise . all ( requestParams . map ( ( params ) => OrderService . fetchShipments ( params . picklistBinIds , params . orderIds , getCurrentFacilityId ( ) ) ) )
177
176
// TODO simplify below logic by returning shipments list
178
177
const shipments = shipmentbatches . flat ( ) ;
179
178
@@ -312,7 +311,6 @@ const actions: ActionTree<OrderState, RootState> = {
312
311
let resp ;
313
312
let orders = [ ] ;
314
313
let total = 0 ;
315
- const currentFacilityId = getCurrentFacilityId ( ) ;
316
314
317
315
const inProgressQuery = JSON . parse ( JSON . stringify ( state . inProgress . query ) )
318
316
@@ -327,7 +325,7 @@ const actions: ActionTree<OrderState, RootState> = {
327
325
picklistItemStatusId : { value : 'PICKITEM_PENDING' } ,
328
326
'-fulfillmentStatus' : { value : [ 'Rejected' , 'Cancelled' ] } ,
329
327
'-shipmentMethodTypeId' : { value : 'STOREPICKUP' } ,
330
- facilityId : { value : escapeSolrSpecialChars ( currentFacilityId ) } ,
328
+ facilityId : { value : escapeSolrSpecialChars ( getCurrentFacilityId ( ) ) } ,
331
329
productStoreId : { value : this . state . user . currentEComStore . productStoreId }
332
330
}
333
331
}
@@ -406,7 +404,6 @@ const actions: ActionTree<OrderState, RootState> = {
406
404
async findOpenOrders ( { commit, state } , payload = { } ) {
407
405
emitter . emit ( 'presentLoader' ) ;
408
406
let resp ;
409
- const currentFacilityId = getCurrentFacilityId ( ) ;
410
407
411
408
const openOrderQuery = JSON . parse ( JSON . stringify ( state . open . query ) )
412
409
@@ -422,7 +419,7 @@ const actions: ActionTree<OrderState, RootState> = {
422
419
'-fulfillmentStatus' : { value : [ 'Cancelled' , 'Rejected' ] } ,
423
420
orderStatusId : { value : 'ORDER_APPROVED' } ,
424
421
orderTypeId : { value : 'SALES_ORDER' } ,
425
- facilityId : { value : escapeSolrSpecialChars ( currentFacilityId ) } ,
422
+ facilityId : { value : escapeSolrSpecialChars ( getCurrentFacilityId ( ) ) } ,
426
423
productStoreId : { value : this . state . user . currentEComStore . productStoreId }
427
424
}
428
425
}
@@ -481,7 +478,6 @@ const actions: ActionTree<OrderState, RootState> = {
481
478
async findCompletedOrders ( { commit, dispatch, state } , payload = { } ) {
482
479
emitter . emit ( 'presentLoader' ) ;
483
480
let resp ;
484
- const currentFacilityId = getCurrentFacilityId ( ) ;
485
481
486
482
const completedOrderQuery = JSON . parse ( JSON . stringify ( state . completed . query ) )
487
483
@@ -494,7 +490,7 @@ const actions: ActionTree<OrderState, RootState> = {
494
490
filters : {
495
491
picklistItemStatusId : { value : '(PICKITEM_PICKED OR (PICKITEM_COMPLETED AND itemShippedDate: [NOW/DAY TO NOW/DAY+1DAY]))' } ,
496
492
'-shipmentMethodTypeId' : { value : 'STOREPICKUP' } ,
497
- facilityId : { value : escapeSolrSpecialChars ( currentFacilityId ) } ,
493
+ facilityId : { value : escapeSolrSpecialChars ( getCurrentFacilityId ( ) ) } ,
498
494
productStoreId : { value : this . state . user . currentEComStore . productStoreId }
499
495
}
500
496
}
@@ -764,7 +760,6 @@ const actions: ActionTree<OrderState, RootState> = {
764
760
}
765
761
766
762
let resp , order = { } as any ;
767
- const currentFacilityId = getCurrentFacilityId ( ) ;
768
763
emitter . emit ( 'presentLoader' ) ;
769
764
770
765
const params = {
@@ -778,7 +773,7 @@ const actions: ActionTree<OrderState, RootState> = {
778
773
'-fulfillmentStatus' : { value : [ 'Cancelled' , 'Rejected' ] } ,
779
774
orderStatusId : { value : 'ORDER_APPROVED' } ,
780
775
orderTypeId : { value : 'SALES_ORDER' } ,
781
- facilityId : { value : escapeSolrSpecialChars ( currentFacilityId ) } ,
776
+ facilityId : { value : escapeSolrSpecialChars ( getCurrentFacilityId ( ) ) } ,
782
777
productStoreId : { value : this . state . user . currentEComStore . productStoreId }
783
778
}
784
779
}
@@ -835,7 +830,6 @@ const actions: ActionTree<OrderState, RootState> = {
835
830
}
836
831
emitter . emit ( 'presentLoader' ) ;
837
832
let resp , order = { } as any ;
838
- const currentFacilityId = getCurrentFacilityId ( ) ;
839
833
840
834
try {
841
835
const params = {
@@ -848,7 +842,7 @@ const actions: ActionTree<OrderState, RootState> = {
848
842
shipGroupSeqId : { value : payload . shipGroupSeqId } ,
849
843
'-fulfillmentStatus' : { value : [ 'Cancelled' , 'Rejected' ] } ,
850
844
'-shipmentMethodTypeId' : { value : 'STOREPICKUP' } ,
851
- facilityId : { value : escapeSolrSpecialChars ( currentFacilityId ) } ,
845
+ facilityId : { value : escapeSolrSpecialChars ( getCurrentFacilityId ( ) ) } ,
852
846
productStoreId : { value : this . state . user . currentEComStore . productStoreId }
853
847
}
854
848
}
@@ -904,7 +898,6 @@ const actions: ActionTree<OrderState, RootState> = {
904
898
}
905
899
emitter . emit ( 'presentLoader' ) ;
906
900
let resp , order = { } as any ;
907
- const currentFacilityId = getCurrentFacilityId ( ) ;
908
901
909
902
try {
910
903
const params = {
@@ -916,7 +909,7 @@ const actions: ActionTree<OrderState, RootState> = {
916
909
picklistItemStatusId : { value : '(PICKITEM_PICKED OR (PICKITEM_COMPLETED AND itemShippedDate: [NOW/DAY TO NOW/DAY+1DAY]))' } ,
917
910
'-shipmentMethodTypeId' : { value : 'STOREPICKUP' } ,
918
911
shipGroupSeqId : { value : payload . shipGroupSeqId } ,
919
- facilityId : { value : escapeSolrSpecialChars ( currentFacilityId ) } ,
912
+ facilityId : { value : escapeSolrSpecialChars ( getCurrentFacilityId ( ) ) } ,
920
913
productStoreId : { value : this . state . user . currentEComStore . productStoreId }
921
914
}
922
915
}
@@ -1031,11 +1024,10 @@ const actions: ActionTree<OrderState, RootState> = {
1031
1024
1032
1025
async fetchCompletedOrderAdditionalInformation ( { dispatch } , order ) {
1033
1026
let current = JSON . parse ( JSON . stringify ( order ) )
1034
- const currentFacilityId = getCurrentFacilityId ( ) ;
1035
1027
1036
1028
try {
1037
1029
// fetchShipments accepts Array parameters for picklistBinId and orderId
1038
- const shipmentBatches = await OrderService . fetchShipments ( [ current . picklistBinId ] , [ current . orderId ] , currentFacilityId )
1030
+ const shipmentBatches = await OrderService . fetchShipments ( [ current . picklistBinId ] , [ current . orderId ] , getCurrentFacilityId ( ) )
1039
1031
const shipments = shipmentBatches . flat ( ) ;
1040
1032
const shipmentIds = [ ...new Set ( shipments . map ( ( shipment : any ) => shipment . shipmentId ) ) ] as Array < string >
1041
1033
let shipmentPackages = [ ] as any ;
0 commit comments