Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: threshold rules not updated in state(#2ngcqdd) #120

Merged
merged 3 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/store/modules/job/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ const actions: ActionTree<JobState, RootState> = {
return Promise.reject(new Error(err))
}
},

removeThresholdRule({ state }, id){
delete state.thresholdRules[id];
},

async fetchJobs ({ state, commit, dispatch }, payload) {
const resp = await JobService.fetchJobInformation({
Expand Down
15 changes: 13 additions & 2 deletions src/views/SelectProduct.vue
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,16 @@ export default defineComponent({
payload['includeAll'] = false;

// Scheduling Job that will run everyday and as system
JobService.scheduleJob({ ...this.job.runtimeData, ...payload }).catch(error => { return error });
this.isFilterChanged = false;
JobService.scheduleJob({ ...this.job.runtimeData, ...payload }).then((resp) => {
if(resp.status === 200 && !hasError(resp) && resp.data){
this.isFilterChanged = false;
this.store.dispatch('job/removeThresholdRule', this.job.runtimeData.searchPreferenceId);
this.$router.push('/threshold-updates')
} else {
console.error(resp);
showToast(translate('Unable to schedule service.'))
}
}).catch(error => { return error });
} else {
console.error(resp);
showToast(translate('Unable to schedule service.'))
Expand All @@ -419,6 +427,8 @@ export default defineComponent({
if(resp.status === 200 && !hasError(resp) && resp.data){
showToast(translate('Service updated successfully'));
this.isFilterChanged = false;
this.store.dispatch('job/removeThresholdRule', this.job.runtimeData.searchPreferenceId);
this.$router.push('/threshold-updates')
} else {
console.error(resp);
showToast(translate('Unable to schedule service.'))
Expand Down Expand Up @@ -491,6 +501,7 @@ export default defineComponent({
value
})
this.queryString = ''
this.isFilterChanged = true;
},
async resetFilters(type: string) {
// checking that if any of the current type does not have any attribute selected than not making solr query
Expand Down