Skip to content

Commit

Permalink
refactor(rc-slice): 🎉 update get-rc case notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
gokhangunduz committed Sep 26, 2023
1 parent 3b1314d commit 86950ce
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
9 changes: 8 additions & 1 deletion src/components/EnvironmentSelector/EnvironmentSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ export default function EnvironmentSelector({
formik.setFieldValue("domainName", environment)
}
>
{environment}
{(() => {
switch (environment) {
case "aiml":
return "AI & ML";
default:
return environment;
}
})()}
</div>
);
})}
Expand Down
2 changes: 1 addition & 1 deletion src/components/SidebarLists/NamespacesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function NamespacesList({
{!Array.isArray(responseNamespaces) ? (
<SidebarListLoader />
) : responseNamespaces.length === 0 ? (
<SidebarInfo text={`Create a Fleet.`} />
<SidebarInfo text={`Create a Namespace.`} />
) : (
responseNamespaces
?.filter((fleet: any) => !fleet.fleetName)
Expand Down
8 changes: 4 additions & 4 deletions src/toolkit/RoboticsCloudSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const createRoboticsCloud = createAsyncThunk(
],
});
return response.data;
}
},
);

export const getRoboticsClouds = createAsyncThunk(
Expand All @@ -28,7 +28,7 @@ export const getRoboticsClouds = createAsyncThunk(
organizationId: values.organizationId,
});
return response.data;
}
},
);

export const roboticsCloudSlice = createSlice({
Expand All @@ -45,15 +45,15 @@ export const roboticsCloudSlice = createSlice({
}
})
.addCase(createRoboticsCloud.rejected, () => {
toast.error("Something went wrong of creating robotics cloud");
toast.error("Something went wrong of creating region.");
})
.addCase(getRoboticsClouds.fulfilled, (_, action: any) => {
if (!action?.payload?.success) {
toast.error(action?.payload?.message);
}
})
.addCase(getRoboticsClouds.rejected, () => {
toast.error("Something went wrong of getting robotics clouds");
toast.error("Something went wrong of getting regions.");
});
},
});
Expand Down

0 comments on commit 86950ce

Please sign in to comment.