Merge pull request #1272 from Safelite/feature/jzimmerman/load_session_missingsavedsessionid_fix

Added savedsessionid to the load session call
This commit is contained in:
Jeremy-Z 2026-06-23 15:34:53 -04:00 committed by GitHub
commit 3e32b7683c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View file

@ -1618,11 +1618,14 @@ export const useMainStore = defineStore({
});
},
async loadSession(duplicate) {
const { order } = this;
const { applicationUser, order } = this;
// NOTE: We are re-using the current user's saved session id (this is required on the load-session call).
// This should be ok, but should probably validate.
const response = await globalMethods.callHttpClient({
method: endpoints.LoadSession.method,
endpoint: endpoints.LoadSession.url,
payload: {
savedSessionId: applicationUser.savedSessionId,
referralNumber: duplicate.referralNumber,
referralDate: duplicate.referralDate,
parentAccountNumber: order.parentAccountNumber,

View file

@ -2236,12 +2236,14 @@ describe('Store', () => {
describe('loadSession method', () => {
let mockDuplicate;
let mockResponse;
let savedSessionId = getRandomGuid();
beforeEach(() => {
mockDuplicate = {
referralNumber: getRandomString(10, 10),
referralDate: new Date().toISOString(),
correlationId: getRandomGuid()
correlationId: getRandomGuid(),
savedSessionId: savedSessionId
};
mockResponse = {
@ -2291,6 +2293,7 @@ describe('Store', () => {
it('should call callHttpClient with correct parameters', async () => {
// Arrange
globalMethods.callHttpClient = jest.fn().mockReturnValue(Promise.resolve(mockResponse));
store.applicationUser.savedSessionId = savedSessionId;
// Act
await store.loadSession(mockDuplicate);
@ -2300,6 +2303,7 @@ describe('Store', () => {
method: endpoints.LoadSession.method,
endpoint: endpoints.LoadSession.url,
payload: {
savedSessionId: mockDuplicate.savedSessionId,
referralNumber: mockDuplicate.referralNumber,
referralDate: mockDuplicate.referralDate,
parentAccountNumber: store.order.parentAccountNumber,