Skip to content

Commit

Permalink
fix: redirect to loginPopup on Manage Organization click if user not …
Browse files Browse the repository at this point in the history
…signed in (#1322)
  • Loading branch information
NSUWAL123 authored Mar 4, 2024
1 parent cb4d3db commit 5cd836f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/frontend/src/api/OrganisationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { GetOrganisationDataModel, OrganisationModal } from '@/models/organisati
import { CommonActions } from '@/store/slices/CommonSlice';
import { OrganisationAction } from '@/store/slices/organisationSlice';
import { API } from '.';
import { createLoginWindow } from '@/utilfunctions/login';

function appendObjectToFormData(formData, object) {
for (const [key, value] of Object.entries(object)) {
Expand Down Expand Up @@ -49,6 +50,9 @@ export const OrganisationDataService: Function = (url: string) => {
dispatch(OrganisationAction.GetOrganisationsData(response));
} catch (error) {
dispatch(OrganisationAction.GetOrganisationDataLoading(false));
if (error.response.status === 401) {
createLoginWindow('/');
}
}
};
await getOrganisationData(url);
Expand Down
1 change: 0 additions & 1 deletion src/frontend/src/views/Organisation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const Organisation = () => {

const { type } = windowDimention();
//get window dimension
console.log(import.meta.env, 'test');

const [searchKeyword, setSearchKeyword] = useState<string>('');
const [activeTab, setActiveTab] = useState<0 | 1>(0);
Expand Down

0 comments on commit 5cd836f

Please sign in to comment.