Skip to content

Commit

Permalink
resolve the duplicate issue
Browse files Browse the repository at this point in the history
  • Loading branch information
VivekY1098 authored and akashthawaitcc committed Dec 26, 2024
1 parent fb9f65d commit 250aef4
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions ui/src/app/components/object-detail/object-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -918,24 +918,36 @@ export class ObjectDetailComponent implements OnInit {
let isDuplicate = false;

this.ccArray.value.forEach((cc: ICcTabData) => {
if(cc.spConstraintName && cc.spConstraintCondition){
if (cc.spConstraintName && cc.spConstraintCondition) {
if (spCkArr.some(item => item.Name === cc.spConstraintName || item.Expr === cc.spConstraintCondition)) {
isDuplicate = true;
} else {
spCkArr.push({
Id: cc.spSno,
Name: cc.spConstraintName,
Expr: cc.spConstraintCondition,
ExprId: cc.spExprId
});
}
}
else{
spCkArr.push({
Id: cc.spSno,
Name: cc.spConstraintName,
Expr: cc.spConstraintCondition,
});
}
} else if (cc.spConstraintCondition) {
if (spCkArr.some(item => item.Expr === cc.spConstraintCondition)) {
isDuplicate = true;
} else {
spCkArr.push({
Id: cc.spSno,
Name: cc.spConstraintName,
Expr: cc.spConstraintCondition,
ExprId: cc.spExprId
});
}
} else {
spCkArr.push({
Id: cc.spSno,
Name: cc.spConstraintName,
Expr: cc.spConstraintCondition,
ExprId: cc.spExprId
});
}
});

if (isDuplicate) {
Expand Down

0 comments on commit 250aef4

Please sign in to comment.