@@ -20,8 +20,7 @@ export abstract class MikroCrudController<
20
20
21
21
async list (
22
22
{ limit, offset, order, filter, expand } : QueryParams < Entity > ,
23
- user : any ,
24
- ...args : any [ ]
23
+ user : any
25
24
) : Promise < unknown > {
26
25
const { total, results } = await this . service . list ( {
27
26
limit,
@@ -44,13 +43,12 @@ export abstract class MikroCrudController<
44
43
async create (
45
44
{ expand } : QueryParams < Entity > ,
46
45
data : CreateDto ,
47
- user : any ,
48
- ...args : any [ ]
46
+ user : any
49
47
) : Promise < unknown > {
50
48
let entity = await this . service . create ( { data, user } ) ;
51
49
await this . service . save ( ) ;
52
50
entity = await this . service . retrieve ( {
53
- conditions : this . getPkCondition ( entity ) ,
51
+ conditions : this . getPrimaryKey ( entity ) ,
54
52
expand,
55
53
refresh : true ,
56
54
user,
@@ -63,8 +61,7 @@ export abstract class MikroCrudController<
63
61
async retrieve (
64
62
lookup : Entity [ LookupField ] ,
65
63
{ expand } : QueryParams < Entity > ,
66
- user : any ,
67
- ...args : any [ ]
64
+ user : any
68
65
) : Promise < unknown > {
69
66
const conditions = { [ this . lookupField ] : lookup } ;
70
67
const entity = await this . service
@@ -85,8 +82,7 @@ export abstract class MikroCrudController<
85
82
lookup : Entity [ LookupField ] ,
86
83
{ expand } : QueryParams < Entity > ,
87
84
data : CreateDto ,
88
- user : any ,
89
- ...args : any [ ]
85
+ user : any
90
86
) : Promise < unknown > {
91
87
const conditions = { [ this . lookupField ] : lookup } ;
92
88
let entity = await this . service
@@ -101,7 +97,7 @@ export abstract class MikroCrudController<
101
97
await this . service . replace ( { entity, data, user } ) ;
102
98
await this . service . save ( ) ;
103
99
entity = await this . service . retrieve ( {
104
- conditions : this . getPkCondition ( entity ) ,
100
+ conditions : this . getPrimaryKey ( entity ) ,
105
101
expand,
106
102
refresh : true ,
107
103
user,
@@ -115,8 +111,7 @@ export abstract class MikroCrudController<
115
111
lookup : Entity [ LookupField ] ,
116
112
{ expand } : QueryParams < Entity > ,
117
113
data : UpdateDto ,
118
- user : any ,
119
- ...args : any [ ]
114
+ user : any
120
115
) : Promise < unknown > {
121
116
const conditions = { [ this . lookupField ] : lookup } ;
122
117
let entity = await this . service
@@ -131,7 +126,7 @@ export abstract class MikroCrudController<
131
126
await this . service . update ( { entity, data, user } ) ;
132
127
await this . service . save ( ) ;
133
128
entity = await this . service . retrieve ( {
134
- conditions : this . getPkCondition ( entity ) ,
129
+ conditions : this . getPrimaryKey ( entity ) ,
135
130
expand,
136
131
refresh : true ,
137
132
user,
@@ -141,11 +136,7 @@ export abstract class MikroCrudController<
141
136
return entity ;
142
137
}
143
138
144
- async destroy (
145
- lookup : Entity [ LookupField ] ,
146
- user : any ,
147
- ...args : any [ ]
148
- ) : Promise < unknown > {
139
+ async destroy ( lookup : Entity [ LookupField ] , user : any ) : Promise < unknown > {
149
140
const conditions = { [ this . lookupField ] : lookup } ;
150
141
const entity = await this . service
151
142
. retrieve ( { conditions, user } )
0 commit comments