Skip to content

Commit

Permalink
Merge pull request #204 from rathoreprashant/#2mky5yp
Browse files Browse the repository at this point in the history
Fixed: Orders are not imported with multiple shopify configuration(#2mky5yp)
  • Loading branch information
adityasharma7 authored Jul 27, 2022
2 parents bf9f9a2 + 5f207fe commit 5adee7a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/store/modules/job/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ const actions: ActionTree<JobState, RootState> = {
return resp;
},

async scheduleService({ dispatch, commit }, job) {
async scheduleService({ dispatch, commit, rootGetters }, job) {
let resp;

const payload = {
Expand All @@ -416,7 +416,7 @@ const actions: ActionTree<JobState, RootState> = {
'runAsUser': 'system', //default system, but empty in run now. TODO Need to remove this as we are using SERVICE_RUN_AS_SYSTEM, currently kept it for backward compatibility
'recurrenceTimeZone': this.state.user.current.userTimeZone
},
'shopifyConfigId': this.state.user.shopifyConfig,
'shopifyConfigId': rootGetters['user/getShopifyConfigId'],
'statusId': "SERVICE_PENDING",
'systemJobEnumId': job.systemJobEnumId
} as any
Expand Down Expand Up @@ -520,7 +520,7 @@ const actions: ActionTree<JobState, RootState> = {
return resp;
},

async runServiceNow({ dispatch }, job) {
async runServiceNow({ dispatch, rootGetters }, job) {
let resp;

const payload = {
Expand All @@ -535,7 +535,7 @@ const actions: ActionTree<JobState, RootState> = {
'parentJobId': job.parentJobId,
'recurrenceTimeZone': this.state.user.current.userTimeZone
},
'shopifyConfigId': this.state.user.shopifyConfig,
'shopifyConfigId': rootGetters['user/getShopifyConfigId'],
'statusId': "SERVICE_PENDING",
'systemJobEnumId': job.systemJobEnumId
} as any
Expand Down
8 changes: 4 additions & 4 deletions src/store/modules/webhook/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import * as types from './mutations-types'
import { translate } from '@/i18n'

const actions: ActionTree<WebhookState, RootState> = {
async fetchWebhooks({ commit }) {
await WebhookService.fetchShopifyWebhooks({ shopifyConfigId: this.state.user.shopifyConfig }).then(resp => {
async fetchWebhooks({ commit, rootGetters }) {
await WebhookService.fetchShopifyWebhooks({ shopifyConfigId: rootGetters['user/getShopifyConfigId'] }).then(resp => {
if (resp.status == 200 && resp.data.webhooks?.length > 0 && !hasError(resp)) {
const webhooks = resp.data.webhooks;
const topics: any = {}
Expand All @@ -35,7 +35,7 @@ const actions: ActionTree<WebhookState, RootState> = {
dispatch('fetchWebhooks')
}
},
async subscribeWebhook({ dispatch }, id: string) {
async subscribeWebhook({ dispatch, rootGetters }, id: string) {

// stores the webhook service that needs to be called on the basis of current webhook selected, doing
// so as we have defined separate service for different webhook subscription
Expand All @@ -58,7 +58,7 @@ const actions: ActionTree<WebhookState, RootState> = {
let resp;

try {
resp = await webhookMethod({ shopifyConfigId: this.state.user.shopifyConfig })
resp = await webhookMethod({ shopifyConfigId: rootGetters['user/getShopifyConfigId'] })

if (resp.status == 200 && !hasError(resp)) {
showToast(translate('Webhook subscribed successfully'))
Expand Down

0 comments on commit 5adee7a

Please sign in to comment.