Removed store mutations.

This commit is contained in:
Jeremy Zimmerman 2022-11-09 13:37:53 -05:00
parent d9c7eff2eb
commit 84dc9bfb73
2 changed files with 2 additions and 55 deletions

View file

@ -3,7 +3,6 @@ import { endpoints } from "@/constants/endpoints.js";
import { getDateForSavedSessionTimeout } from "@/helpers/heritage-integration/session-helper";
import globalMethods from "@/global-methods";
import { applicationConfig } from "@/constants/application-config";
import { experimentTriggers } from "@/constants/experiments";
const storeId = 'main';
@ -189,36 +188,7 @@ export const useMainStore = defineStore({
endpoint: `${endpoints.GetVehicleStyles.url}/${this.order.vehicle.year}/${this.order.vehicle.make}/${this.order.vehicle.model}`,
payload: {},
});
},
// Vehicle API Actions
updateVehicleYear(year)
{
if (this.order.vehicle.year !== year) {
this.order.vehicle.year = year;
}
},
updateVehicleMake(make)
{
if (this.order.vehicle.make !== make) {
this.order.vehicle.make = make;
}
},
updateVehicleModel(model)
{
if (this.order.vehicle.model !== model) {
this.order.vehicle.model = model;
}
},
updateVehicleStyle(style)
{
if (this.order.vehicle.style !== style) {
this.order.vehicle.style = style;
}
},
},
addEventToBus (event) {
this.applicationUser.eventBus.push(event);
},
@ -343,29 +313,6 @@ export const useMainStore = defineStore({
});
},
async runExperimentsForTrigger(context, { userId, triggerEvent, triggerValue }) {
if (triggerEvent == experimentTriggers.SITE_ENTRY) {
context.commit(storeMutations.UPDATE_TRIGGERED_SITE_ENTRY, true);
}
var payload = {
applicationName: applicationConfig.APPLICATION_NAME,
userId: userId,
triggerEvent: triggerEvent,
triggerValue: triggerValue,
experimentOrder: context.getters.experimentOrder,
};
const response = await globalMethods.callHttpClient({
method: endpoints.RunExperimentsForTrigger.method,
endpoint: endpoints.RunExperimentsForTrigger.url,
payload: payload,
});
context.commit(storeMutations.UPDATE_EXPERIMENTS, response.data.experiments);
},
},
persist: true
});

View file

@ -21,7 +21,7 @@ describe("Store", () => {
it("Should Store Vehicle Year", () => {
let testYear = "2001";
store.updateVehicleYear(testYear);
store.order.vehicle.year = testYear;
expect(store.order.vehicle.year).toEqual(testYear);
});