Skip to content

Commit

Permalink
Merge pull request #65 from Rushikesh-Sonawane99/release-1.0.0
Browse files Browse the repository at this point in the history
Issue #000 chore: Added tenantId in config file and imported it from there across app
  • Loading branch information
itsvick authored Aug 1, 2024
2 parents 4aa59ca + c1bded5 commit 31ac63a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const avgLearnerAttendanceLimit: number = 66;
export const dashboardDaysLimit: number = 30;
export const modifyAttendanceLimit: number = 6;
export const toastAutoHideDuration: number = 5000; // 5 seconds
export const tenantId: string = 'ef99949b-7f3a-4a5f-806a-e67e683e38f3';

export const dropoutReasons = [
{
Expand Down
3 changes: 2 additions & 1 deletion src/components/AddFacilitator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { RJSFSchema } from '@rjsf/utils';
import { useTranslation } from 'next-i18next';
import { showToastMessage } from './Toastify';
import { editEditUser } from '@/services/ProfileService';
import { tenantId } from '../../app.config';

interface AddFacilitatorModalprops {
open: boolean;
Expand Down Expand Up @@ -127,7 +128,7 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
password: password,
tenantCohortRoleMapping: [
{
tenantId: 'ef99949b-7f3a-4a5f-806a-e67e683e38f3',
tenantId: tenantId,
roleId: RoleId.TEACHER,
cohortId: formData?.assignCenters,
},
Expand Down
3 changes: 2 additions & 1 deletion src/components/AddLeanerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import React, { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { showToastMessage } from './Toastify';
import { editEditUser } from '@/services/ProfileService';
import { tenantId } from '../../app.config';

interface AddLearnerModalProps {
open: boolean;
Expand Down Expand Up @@ -106,7 +107,7 @@ const AddLearnerModal: React.FC<AddLearnerModalProps> = ({
password: password,
tenantCohortRoleMapping: [
{
tenantId: 'ef99949b-7f3a-4a5f-806a-e67e683e38f3',
tenantId: tenantId,
roleId: RoleId.STUDENT,
cohortId: [cohortId],
},
Expand Down
3 changes: 2 additions & 1 deletion src/services/CreateUserService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import axios from 'axios';
import { get, post } from './RestClient';
import { tenantId } from '../../app.config';

export const getFormRead = async (
context: string,
Expand All @@ -18,7 +19,7 @@ export const getFormRead = async (
.map(([key, value]) => `${key}=${value}`)
.join('&');
},
headers: { tenantId: 'ef99949b-7f3a-4a5f-806a-e67e683e38f3' },
headers: { tenantId: tenantId },
}
);

Expand Down
3 changes: 2 additions & 1 deletion src/services/Interceptor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import axios from 'axios';
import { refresh } from './LoginService';
import { tenantId } from '../../app.config';

const instance = axios.create();

Expand Down Expand Up @@ -32,7 +33,7 @@ instance.interceptors.request.use(
}
// config.headers.tenantid = '4783a636-1191-487a-8b09-55eca51b5036';
// config.headers.tenantid = 'fbe108db-e236-48a7-8230-80d34c370800';
config.headers.tenantid = 'ef99949b-7f3a-4a5f-806a-e67e683e38f3';
config.headers.tenantid = tenantId;
return config;
},
(error) => {
Expand Down

0 comments on commit 31ac63a

Please sign in to comment.