@@ -50,25 +50,25 @@ class BusinessRepository implements IRepository {
50
50
companyName,
51
51
ownerId,
52
52
} : Partial < BusinessEntityT > ) : Promise < OperationResult < boolean > > {
53
- const filterClause : SQL [ ] = [ ] ;
53
+ const filterClauses : SQL [ ] = [ ] ;
54
54
55
55
if ( id ) {
56
- filterClause . push ( eq ( this . businessSchema . id , id ) ) ;
56
+ filterClauses . push ( eq ( this . businessSchema . id , id ) ) ;
57
57
}
58
58
59
59
if ( taxNumber ) {
60
- filterClause . push ( eq ( this . businessSchema . taxNumber , taxNumber ) ) ;
60
+ filterClauses . push ( eq ( this . businessSchema . taxNumber , taxNumber ) ) ;
61
61
}
62
62
63
63
if ( companyName ) {
64
- filterClause . push ( eq ( this . businessSchema . companyName , companyName ) ) ;
64
+ filterClauses . push ( eq ( this . businessSchema . companyName , companyName ) ) ;
65
65
}
66
66
67
67
if ( ownerId ) {
68
- filterClause . push ( eq ( this . businessSchema . ownerId , ownerId ) ) ;
68
+ filterClauses . push ( eq ( this . businessSchema . ownerId , ownerId ) ) ;
69
69
}
70
70
71
- if ( filterClause . length === 0 ) {
71
+ if ( filterClauses . length === 0 ) {
72
72
throw new ApplicationError ( {
73
73
message : AppErrorMessage . INVALID_QUERY ,
74
74
} ) ;
@@ -78,7 +78,7 @@ class BusinessRepository implements IRepository {
78
78
. driver ( )
79
79
. select ( )
80
80
. from ( this . businessSchema )
81
- . where ( or ( ...filterClause ) ) ;
81
+ . where ( or ( ...filterClauses ) ) ;
82
82
83
83
return {
84
84
result : Boolean ( business ) ,
0 commit comments