WizardV2: map oscap to wizard request

This commit is contained in:
Amir 2024-04-04 20:22:22 +03:00 committed by Lucas Garfield
parent a7f46e938d
commit ba3a2dc333
6 changed files with 138 additions and 186 deletions

View file

@ -16,6 +16,7 @@ import { useNavigate, useParams } from 'react-router-dom';
import CreateDropdown from './CreateDropdown';
import EditDropdown from './EditDropdown';
import { useServerStore } from '../../../../../store/hooks';
import {
useCreateBlueprintMutation,
useUpdateBlueprintMutation,
@ -33,6 +34,9 @@ const ReviewWizardFooter = () => {
reset: resetCreate,
},
] = useCreateBlueprintMutation({ fixedCacheKey: 'createBlueprintKey' });
// initialize the server store with the data from RTK query
const serverStore = useServerStore();
const [
,
{
@ -61,7 +65,7 @@ const ReviewWizardFooter = () => {
const getBlueprintPayload = async () => {
const userData = await auth?.getUser();
const orgId = userData?.identity?.internal?.org_id;
const requestBody = orgId && mapRequestFromState(store, orgId);
const requestBody = orgId && mapRequestFromState(store, orgId, serverStore);
return requestBody;
};