Skip to content

Commit

Permalink
Merge pull request #7450 from ashanthamara/actions
Browse files Browse the repository at this point in the history
Fix server host resolving issue in rule get resources api
  • Loading branch information
ashanthamara authored Jan 29, 2025
2 parents 5790e49 + 1d6cd65 commit f5c8217
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-kiwis-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/admin.rules.v1": patch
---

Fix server Host resolving issue in rule get resources api
4 changes: 2 additions & 2 deletions features/admin.rules.v1/api/use-get-resource-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
* under the License.
*/

import { Config } from "@wso2is/admin.core.v1/configs/app";
import useRequest, {
RequestConfigInterface,
RequestErrorInterface,
RequestResultInterface
} from "@wso2is/admin.core.v1/hooks/use-request";
import { store } from "@wso2is/admin.core.v1/store";
import { HttpMethods } from "@wso2is/core/models";

/**
Expand All @@ -44,7 +44,7 @@ const useGetResourcesList = <Data = any, Error = RequestErrorInterface>(
"Content-Type": "application/json"
},
method: HttpMethods.GET,
url: store.getState().config.deployment.idpConfigs.serverOrigin + `/api/server/v1${endpointPath}`
url: Config.resolveServerHost() + `/api/server/v1${endpointPath}`
};

const { data, error, isLoading, isValidating, mutate } = useRequest<Data, Error>(
Expand Down
4 changes: 2 additions & 2 deletions features/admin.rules.v1/api/use-get-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
* under the License.
*/

import { Config } from "@wso2is/admin.core.v1/configs/app";
import useRequest, {
RequestConfigInterface,
RequestErrorInterface,
RequestResultInterface
} from "@wso2is/admin.core.v1/hooks/use-request";
import { store } from "@wso2is/admin.core.v1/store";
import { HttpMethods } from "@wso2is/core/models";

/**
Expand All @@ -44,7 +44,7 @@ const useGetResourceDetails = <Data = any, Error = RequestErrorInterface>(
"Content-Type": "application/json"
},
method: HttpMethods.GET,
url: store.getState().config.deployment.idpConfigs.serverOrigin + `/api/server/v1${endpointPath}`
url: Config.resolveServerHost() + `/api/server/v1${endpointPath}`
};

const { data, error, isLoading, isValidating, mutate } = useRequest<Data, Error>(
Expand Down

0 comments on commit f5c8217

Please sign in to comment.