fix: init cluster id when deploy model
This commit is contained in:
@@ -177,9 +177,9 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
};
|
||||
|
||||
const initClusterId = (): number => {
|
||||
const cluster_id = clusterList?.find(
|
||||
(item) => item.state === ClusterStatusValueMap.Ready
|
||||
)?.value;
|
||||
const cluster_id =
|
||||
clusterList?.find((item) => item.state === ClusterStatusValueMap.Ready)
|
||||
?.value || clusterList?.[0]?.value;
|
||||
|
||||
return cluster_id as number;
|
||||
};
|
||||
|
||||
@@ -443,7 +443,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
||||
}
|
||||
const cluster_id =
|
||||
clusterList?.find((item) => item.state === ClusterStatusValueMap.Ready)
|
||||
?.value || '';
|
||||
?.value || clusterList?.[0]?.value;
|
||||
|
||||
return cluster_id;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user