Skip to content

Commit

Permalink
Merge pull request #6062 from DilshanSenarath/asg-issue-23404
Browse files Browse the repository at this point in the history
Fix the function not defined error when the custom text are not configured.
  • Loading branch information
pavinduLakshan authored Apr 25, 2024
2 parents 57ce446 + 76db512 commit 4931e39
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/empty-wombats-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/features": patch
---

Fix the function not defined error when the custom text are not configured.
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,6 @@ const useGetCustomTextPreferenceResolve = <
shouldRetryOnError: false
});

if ((error?.response?.data as any)?.code
=== CustomTextPreferenceConstants.CUSTOM_TEXT_PREFERENCE_NOT_CONFIGURED_ERROR_CODE) {
return {
data: null,
error,
isLoading: !error && !data,
isValidating,
mutate
};
}

/**
* This function is used to mutate the request cache of custom text preference retrieval requests
* across all screens.
Expand All @@ -111,6 +100,18 @@ const useGetCustomTextPreferenceResolve = <
);
};

if ((error?.response?.data as any)?.code
=== CustomTextPreferenceConstants.CUSTOM_TEXT_PREFERENCE_NOT_CONFIGURED_ERROR_CODE) {
return {
data: null,
error,
isLoading: !error && !data,
isValidating,
mutate,
mutateMultiple
};
}

return {
data,
error,
Expand Down

0 comments on commit 4931e39

Please sign in to comment.