Skip to content

Commit

Permalink
Merge pull request #375 from hotwax/#373
Browse files Browse the repository at this point in the history
Fixed: Save button while creating a batch for broker order service does not work (#373)
  • Loading branch information
adityasharma7 authored Feb 8, 2023
2 parents b429025 + 0cef8b9 commit 24a9bb5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/components/BatchModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ import { defineComponent } from 'vue';
import { closeOutline, checkmarkDoneOutline } from 'ionicons/icons';
import { mapGetters, useStore } from 'vuex';
import { DateTime } from 'luxon';
import { handleDateTimeInput, isFutureDate } from '@/utils';
import { handleDateTimeInput, isFutureDate, showToast } from '@/utils';
import { translate } from '@/i18n'
export default defineComponent({
name: 'BatchModal',
components: {
Expand Down Expand Up @@ -143,6 +144,7 @@ export default defineComponent({
const job = this.currentBatch ? this.currentBatch : this.getJob(batchJobEnum)?.find((job: any) => job.status === 'SERVICE_DRAFT');
if (!job) {
showToast(translate('Configuration missing'))
return;
}
Expand Down
6 changes: 4 additions & 2 deletions src/store/modules/job/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ const actions: ActionTree<JobState, RootState> = {
// Earlier we were having ORing on status only, but now we want to add condition for shopId as well
// Instead of complicating the query, we have made 2 separate call with status conditions and merged them


// Fetching the draft jobs first
const fetchJobRequests = [];
let params = {
Expand Down Expand Up @@ -397,8 +396,11 @@ const actions: ActionTree<JobState, RootState> = {
// If query is for single systemJobEnumId only update it
if (typeof payload.inputFields.systemJobEnumId === "string" && batchJobEnumIds.includes(payload.inputFields.systemJobEnumId)) {
batchJobEnumIds = [ payload.inputFields.systemJobEnumId ];
} else if (typeof payload.inputFields.systemJobEnumId === "object") {
} else if (payload.inputFields.systemJobEnumId && typeof payload.inputFields.systemJobEnumId === "object") {
batchJobEnumIds = batchJobEnumIds.filter((batchJobEnumId: any) => payload.inputFields.systemJobEnumId.includes(batchJobEnumId));
} else {
// If we are not explicitly getting the batch jobs skip updating it in cache
batchJobEnumIds = [];
}
batchJobEnumIds.map((batchBrokeringJobEnum: any) => {
cached[batchBrokeringJobEnum] = responseJobs.filter((job: any) => job.systemJobEnumId === batchBrokeringJobEnum).reduce((batchBrokeringJobs: any, job: any) => {
Expand Down
8 changes: 4 additions & 4 deletions src/views/Orders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -456,19 +456,19 @@ export default defineComponent({
});
return jobAlert.present();
},
fetchJobs(){
this.store.dispatch("job/fetchJobs", {
async fetchJobs(){
this.store.dispatch('webhook/fetchWebhooks')
await this.store.dispatch("job/fetchJobs", {
"inputFields": {
"enumTypeId": "ORDER_SYS_JOB"
}
});
this.store.dispatch("job/fetchJobs", {
await this.store.dispatch("job/fetchJobs", {
"inputFields": {
"systemJobEnumId": Object.values(this.batchJobEnums).map((jobEnum: any) => jobEnum.id),
"systemJobEnumId_op": "in"
}
});
this.store.dispatch('webhook/fetchWebhooks')
if (this.currentEComStore.productStoreId) {
this.getAutoCancelDays();
}
Expand Down

0 comments on commit 24a9bb5

Please sign in to comment.