Skip to content

Commit

Permalink
Fix: fail if organisations undefined in indicators (#1039)
Browse files Browse the repository at this point in the history
* manage if undefined

* set initial value
  • Loading branch information
PierreVasseur authored Oct 15, 2024
1 parent 7941ed5 commit caa3864
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/packages/auth/open-id-connect-auth/use-oidc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ type OidcWrapperTypes = {
};

export const LoginComponent = () => {
const { isUserLoggedIn, login } = useOidc({
const { login } = useOidc({
assertUserLoggedIn: false,
});

if (!isUserLoggedIn) {
if (login) {
login({
doesCurrentHrefRequiresAuth: true,
});
Expand Down
1 change: 1 addition & 0 deletions src/packages/utils/hooks/organizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { transformModelToSelectOptions } from '../transformer';

export const useOrganizations = () => {
return useQuery({
initialData: [],
queryKey: ['organization'],
queryFn: (): Promise<Organization[]> => {
return OrganisationsApi.getOrganisations() as Promise<Organization[]>;
Expand Down

0 comments on commit caa3864

Please sign in to comment.