File tree 1 file changed +21
-5
lines changed
1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -55,12 +55,8 @@ class UserRoleService {
55
55
/**
56
56
*
57
57
* @param formData
58
- * @param txn Transaction Sequelize
59
58
*/
60
- public static async findOrCreate (
61
- formData : UserRoleAttributes ,
62
- txn ?: Transaction
63
- ) {
59
+ public static async findOrCreate ( formData : UserRoleAttributes ) {
64
60
const values = useValidation ( schema . create , formData )
65
61
66
62
const data = await UserRole . findOrCreate ( {
@@ -73,6 +69,7 @@ class UserRoleService {
73
69
/**
74
70
*
75
71
* @param id
72
+ * @param force
76
73
*/
77
74
public static async deleteByUserId ( id : string , force ?: boolean ) {
78
75
const isForce = validateBoolean ( force )
@@ -87,10 +84,29 @@ class UserRoleService {
87
84
} )
88
85
}
89
86
87
+ /**
88
+ *
89
+ * @param id
90
+ * @param force
91
+ */
92
+ public static async deleteByUserIds ( ids : Array < string > , force ?: boolean ) {
93
+ const isForce = validateBoolean ( force )
94
+
95
+ await UserRole . destroy ( {
96
+ where : {
97
+ UserId : {
98
+ [ Op . in ] : ids ,
99
+ } ,
100
+ } ,
101
+ force : isForce ,
102
+ } )
103
+ }
104
+
90
105
/**
91
106
*
92
107
* @param id
93
108
* @param Roles Array of String
109
+ * @param force
94
110
* @example
95
111
* Roles = ['id_1', 'id_2']
96
112
*/
You can’t perform that action at this time.
0 commit comments