Skip to content

Commit

Permalink
Merge pull request #134 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
[pull] dev from KelvinTegelaar:dev
  • Loading branch information
pull[bot] authored Mar 3, 2025
2 parents 9c3e9e1 + e687383 commit c9f4747
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/api/ApiCall.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import axios, { isAxiosError } from "axios";
import { useDispatch } from "react-redux";
import { showToast } from "../store/toasts";
import { getCippError } from "../utils/get-cipp-error";
import { useRouter } from "next/router";

export function ApiGetCall(props) {
const {
Expand All @@ -29,6 +28,12 @@ export function ApiGetCall(props) {
returnRetry = false;
}
if (isAxiosError(error) && HTTP_STATUS_TO_NOT_RETRY.includes(error.response?.status ?? 0)) {
if (
error.response?.status === 302 &&
error.response?.headers.get("location").includes("/.auth/login/aad")
) {
queryClient.invalidateQueries({ queryKey: ["authmecipp"] });
}
returnRetry = false;
}
if (returnRetry === false && toast) {
Expand Down
22 changes: 21 additions & 1 deletion src/components/CippFormPages/CippAddEditUser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ const CippAddEditUser = (props) => {
multiple={false}
/>
</Grid>
{/* Schedule User Creation */}
<Grid item xs={12}>
<CippFormUserSelector
formControl={formControl}
Expand All @@ -300,6 +299,27 @@ const CippAddEditUser = (props) => {
multiple={false}
/>
</Grid>
{formType === "edit" && (
<Grid item xs={12}>
<CippFormComponent
type="autoComplete"
label="Add to Groups"
name="AddToGroups"
multiple={true}
api={{
url: "/api/ListGroups",
queryKey: `ListGroups-${tenantDomain}`,
labelField: "displayName",
valueField: "id",
addedField: {
calculatedGroupType: "calculatedGroupType",
},
}}
formControl={formControl}
/>
</Grid>
)}
{/* Schedule User Creation */}
{formType === "add" && (
<Grid item xs={12}>
<CippFormComponent
Expand Down

0 comments on commit c9f4747

Please sign in to comment.