Skip to content

Commit

Permalink
Merge pull request #81 from AkshataKatwal16/admin
Browse files Browse the repository at this point in the history
Issue #PS-1498: feat: integrate create and update team leader flow
  • Loading branch information
itsvick authored Aug 1, 2024
2 parents b6ac985 + 4989899 commit dec9bf4
Show file tree
Hide file tree
Showing 14 changed files with 557 additions and 67 deletions.
1 change: 1 addition & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const tenantId = "ef99949b-7f3a-4a5f-806a-e67e683e38f3"
2 changes: 1 addition & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"CODE_NOTIFICATION": "Code Should Be Fill With Captial Letters",
"USER_DELETE_SUCCSSFULLY": "User deleted Successfully",
"STATE_NAME": "State Name",
"FILTER_BY_STATUS": "Filter By Status :"
"FILTER_BY_STATUS": "Filter By Status"
},
"LOGIN_PAGE": {
"USERNAME": "Username",
Expand Down
5 changes: 3 additions & 2 deletions src/components/AddFacilitator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import AreaSelection from "./AreaSelection";
import { showToastMessage } from "./Toastify";
import { transformArray } from "../utils/Helper";
import { useLocationState } from "@/utils/useLocationState";
import { tenantId } from "../../app.config";

interface AddFacilitatorModalprops {
open: boolean;
Expand Down Expand Up @@ -141,7 +142,7 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
password: password,
tenantCohortRoleMapping: [
{
tenantId: "ef99949b-7f3a-4a5f-806a-e67e683e38f3",
tenantId: tenantId,
roleId: RoleId.TEACHER,
cohortId: [selectedCenterCode],
},
Expand Down Expand Up @@ -216,7 +217,7 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
customFields: customFields,
};
const response = await updateUser(userId, object);
showToastMessage(t("LEARNERS.LEARNER_UPDATED_SUCCESSFULLY"), "success");
showToastMessage(t("FACILITATORS.FACILITATOR_UPDATED_SUCCESSFULLY"), "success");
} else {
try{
const response = await createUser(apiBody);
Expand Down
6 changes: 3 additions & 3 deletions src/components/AddLeanerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { useTranslation } from "react-i18next";
import { transformArray } from "../utils/Helper";
import AreaSelection from "./AreaSelection";
import { showToastMessage } from "./Toastify";
import { tenantId } from "../../app.config";

interface AddLearnerModalProps {
open: boolean;
Expand Down Expand Up @@ -106,8 +107,7 @@ const AddLearnerModal: React.FC<AddLearnerModalProps> = ({
const target = event.target as HTMLFormElement;
const elementsArray = Array.from(target.elements);


console.log("onsubmit", data);
console.log("onsubmit", data);
// for (const element of elementsArray) {
// if (
// (element instanceof HTMLInputElement ||
Expand Down Expand Up @@ -140,7 +140,7 @@ console.log("onsubmit", data);
password: password,
tenantCohortRoleMapping: [
{
tenantId: "ef99949b-7f3a-4a5f-806a-e67e683e38f3",
tenantId: tenantId,
roleId: RoleId.STUDENT,
cohortId: [selectedCenterCode],
},
Expand Down
Loading

0 comments on commit dec9bf4

Please sign in to comment.