File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ const internalAccessList = {
25
25
create : ( access , data ) => {
26
26
return access . can ( 'access_lists:create' , data )
27
27
. then ( ( /*access_data*/ ) => {
28
+ if ( ( typeof data . items === 'undefined' || ! data . items . length ) && ( typeof data . clients === 'undefined' || ! data . clients . length ) ) {
29
+ throw new error . InternalValidationError ( 'At leaste one user/pass or address must be defined' ) ;
30
+ }
31
+
28
32
return accessListModel
29
33
. query ( )
30
34
. omit ( omissions ( ) )
@@ -110,6 +114,10 @@ const internalAccessList = {
110
114
update : ( access , data ) => {
111
115
return access . can ( 'access_lists:update' , data . id )
112
116
. then ( ( /*access_data*/ ) => {
117
+ if ( ( typeof data . items === 'undefined' || ! data . items . length ) && ( typeof data . clients === 'undefined' || ! data . clients . length ) ) {
118
+ throw new error . InternalValidationError ( 'At leaste one user/pass or address must be defined' ) ;
119
+ }
120
+
113
121
return internalAccessList . get ( access , { id : data . id } ) ;
114
122
} )
115
123
. then ( ( row ) => {
You can’t perform that action at this time.
0 commit comments