Skip to content

Commit

Permalink
added mdms from global config (#1427)
Browse files Browse the repository at this point in the history
* added mdms from global config

* Update getMDMSUrl.js

---------

Co-Authored-By: Jagankumar <[email protected]>
  • Loading branch information
jagankumar-egov committed Sep 26, 2024
1 parent 05ef172 commit d518803
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from "react";
import { Fragment } from "react";
import { Button, PopUp } from "@egovernments/digit-ui-components";
import TimelineComponent from "../components/TimelineComponent";
import getMDMSUrl from "../utils/getMDMSUrl";
//create functions here based on module name set in mdms(eg->SearchProjectConfig)
//how to call these -> Digit?.Customizations?.[masterName]?.[moduleName]
// these functions will act as middlewares
Expand Down Expand Up @@ -72,9 +73,9 @@ export const UICustomizations = {
},
populateCampaignTypeReqCriteria: () => {
const tenantId = Digit.ULBService.getCurrentTenantId();

const url = getMDMSUrl();
return {
url: "/egov-mdms-service/v1/_search",
url: `${url}/v1/_search`,
params: { tenantId },
body: {
MdmsCriteria: {
Expand Down Expand Up @@ -229,9 +230,9 @@ export const UICustomizations = {
},
populateCampaignTypeReqCriteria: () => {
const tenantId = Digit.ULBService.getCurrentTenantId();

const url = getMDMSUrl();
return {
url: "/egov-mdms-service/v1/_search",
url: `${url}/v1/_search`,
params: { tenantId },
body: {
MdmsCriteria: {
Expand Down Expand Up @@ -367,9 +368,9 @@ export const UICustomizations = {
},
populateCampaignTypeReqCriteria: () => {
const tenantId = Digit.ULBService.getCurrentTenantId();

const url = getMDMSUrl();
return {
url: "/egov-mdms-service/v1/_search",
url: `${url}/v1/_search`,
params: { tenantId },
body: {
MdmsCriteria: {
Expand Down Expand Up @@ -528,9 +529,9 @@ export const UICustomizations = {
},
populateCampaignTypeReqCriteria: () => {
const tenantId = Digit.ULBService.getCurrentTenantId();

const url = getMDMSUrl();
return {
url: "/egov-mdms-service/v1/_search",
url: `${url}/v1/_search`,
params: { tenantId },
body: {
MdmsCriteria: {
Expand Down Expand Up @@ -618,9 +619,9 @@ export const UICustomizations = {
},
populateCampaignTypeReqCriteria: () => {
const tenantId = Digit.ULBService.getCurrentTenantId();

const url = getMDMSUrl();
return {
url: "/egov-mdms-service/v1/_search",
url: `${url}/v1/_search`,
params: { tenantId },
body: {
MdmsCriteria: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const getMDMSUrl = () => {
let url = window.globalConfigs?.getConfig("MDMS_V1_CONTEXT_PATH") || window.globalConfigs?.getConfig("MDMS_CONTEXT_PATH") || "egov-mdms-service";
return `/${url}`;
};
export default getMDMSUrl;

0 comments on commit d518803

Please sign in to comment.