Skip to content

Commit

Permalink
used utility function for handle alert component issue
Browse files Browse the repository at this point in the history
Signed-off-by: pranalidhanavade <[email protected]>
  • Loading branch information
pranalidhanavade committed Oct 9, 2024
1 parent 4825f67 commit b67396a
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 10 deletions.
139 changes: 139 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/components/AlertComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ export const AlertComponent = ({
console.log("message",message);
console.log(typeof message)
return (
message === null||'' ? (<>
(message === null || '') ? (<>
</>):
(

(
<div className="w-full">
<div
Expand Down
12 changes: 4 additions & 8 deletions src/components/User/UserDashBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ const UserDashBoard = () => {

const getAllInvitations = async () => {
setLoading(true);
setMessage(''); // Clear any previous messages
setError(''); // Clear any previous errors
try {
const response = await getUserInvitations(
currentPage.pageNumber,
Expand All @@ -108,8 +106,8 @@ const UserDashBoard = () => {
total: totalPages,
});
} else {
// setError(response as string);
setError(data?.message as string || 'Failed to fetch invitations');
setError(response as string);
// setError(data?.message as string || 'Failed to fetch invitations');
}
} catch(err) {
setError('An unexpected error occurred');
Expand Down Expand Up @@ -139,8 +137,6 @@ const UserDashBoard = () => {

const getAllEcosystemInvitations = async () => {
setLoading(true);
setMessage(''); // Clear any previous messages
setError(''); // Clear any previous errors
try {

const response = await getUserEcosystemInvitations(
Expand All @@ -166,8 +162,8 @@ const UserDashBoard = () => {
total: totalPages,
});
} else {
// setError(response as string);
setError(data?.message as string || 'Failed to fetch ecosystem invitations');
setError(response as string);
// setError(data?.message as string || 'Failed to fetch ecosystem invitations');
}
}
catch(err){
Expand Down

0 comments on commit b67396a

Please sign in to comment.