Skip to content

Commit

Permalink
Fix spread issue
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Apr 26, 2024
1 parent 3ee6168 commit 0d8c2a9
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/views/tenant/standards/ListAppliedStandards.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef, useState } from 'react'
import React, { useEffect, useRef, useState } from 'react'
import {
CButton,
CCallout,
Expand Down Expand Up @@ -118,7 +118,7 @@ const ApplyNewStandard = () => {
size="sm"
color="success"
variant="ghost"
onClick={() => templateStandardSet(row)}
onClick={() => templateStandardSet(row.standards)}
>
<FontAwesomeIcon icon={'check'} />
</CButton>
Expand Down Expand Up @@ -179,6 +179,13 @@ const ApplyNewStandard = () => {
exportSelector: 'GUID',
omit: true,
},
{
name: 'standards',
selector: (row) => row['standards'],
sortable: true,
exportSelector: 'standards',
omit: true,
},
{
name: 'Actions',
cell: Offcanvas,
Expand Down Expand Up @@ -251,7 +258,7 @@ const ApplyNewStandard = () => {
})

const tenantDomain = useSelector((state) => state.app.currentTenant.defaultDomainName)

console.log('tenantDomain', tenantDomain)
const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery()

const { data: listStandardsAllTenants = [] } = useGenericGetRequestQuery({
Expand Down Expand Up @@ -279,15 +286,14 @@ const ApplyNewStandard = () => {
//filter on only objects that are 'true'
genericPostRequest({
path: '/api/AddStandardsDeploy',
values: { tenant: tenantDomain, ...values.standards },
values: { ...values.standards, tenant: tenantDomain },
})
}
const [intuneGetRequest, intuneTemplates] = useLazyGenericGetRequestQuery()
const [transportGetRequest, transportTemplates] = useLazyGenericGetRequestQuery()
const [exConnectorGetRequest, exConnectorTemplates] = useLazyGenericGetRequestQuery()
const [caGetRequest, caTemplates] = useLazyGenericGetRequestQuery()
const [groupGetRequest, groupTemplates] = useLazyGenericGetRequestQuery()
const initialValues = templateStandard ? templateStandard : listStandardResults[0]
const allTenantsStandard = listStandardsAllTenants.find(
(tenant) => tenant.displayName === 'AllTenants',
)
Expand Down Expand Up @@ -381,7 +387,13 @@ const ApplyNewStandard = () => {
groupGetRequest({ path: 'api/ListGroupTemplates' })}
{isSuccess && !isFetching && (
<Form
initialValues={initialValues}
initialValues={{
...listStandardResults[0],
standards: {
...listStandardResults[0].standards,
...templateStandard,
},
}}
onSubmit={handleSubmit}
render={({ handleSubmit, submitting, values }) => {
return (
Expand Down

0 comments on commit 0d8c2a9

Please sign in to comment.