@@ -37,7 +37,7 @@ import { RelationQueryService } from './relation-query.service';
37
37
*/
38
38
export class SequelizeQueryService < Entity extends Model < Entity > >
39
39
extends RelationQueryService < Entity >
40
- implements QueryService < Entity > {
40
+ implements QueryService < Entity , DeepPartial < Entity > , DeepPartial < Entity > > {
41
41
readonly filterQueryBuilder : FilterQueryBuilder < Entity > ;
42
42
43
43
constructor ( readonly model : ModelCtor < Entity > ) {
@@ -123,7 +123,7 @@ export class SequelizeQueryService<Entity extends Model<Entity>>
123
123
* ```
124
124
* @param record - The entity to create.
125
125
*/
126
- async createOne < C extends DeepPartial < Entity > > ( record : C ) : Promise < Entity > {
126
+ async createOne ( record : DeepPartial < Entity > ) : Promise < Entity > {
127
127
await this . ensureEntityDoesNotExist ( record ) ;
128
128
return this . model . create < Entity > ( this . getChangedValues ( record ) ) ;
129
129
}
@@ -140,7 +140,7 @@ export class SequelizeQueryService<Entity extends Model<Entity>>
140
140
* ```
141
141
* @param records - The entities to create.
142
142
*/
143
- async createMany < C extends DeepPartial < Entity > > ( records : C [ ] ) : Promise < Entity [ ] > {
143
+ async createMany ( records : DeepPartial < Entity > [ ] ) : Promise < Entity [ ] > {
144
144
await Promise . all ( records . map ( ( r ) => this . ensureEntityDoesNotExist ( r ) ) ) ;
145
145
return this . model . bulkCreate < Entity > ( records . map ( ( r ) => this . getChangedValues ( r ) ) ) ;
146
146
}
@@ -156,11 +156,7 @@ export class SequelizeQueryService<Entity extends Model<Entity>>
156
156
* @param update - A `Partial` of the entity with fields to update.
157
157
* @param opts - Additional options.
158
158
*/
159
- async updateOne < U extends DeepPartial < Entity > > (
160
- id : number | string ,
161
- update : U ,
162
- opts ?: UpdateOneOptions < Entity > ,
163
- ) : Promise < Entity > {
159
+ async updateOne ( id : number | string , update : DeepPartial < Entity > , opts ?: UpdateOneOptions < Entity > ) : Promise < Entity > {
164
160
this . ensureIdIsNotPresent ( update ) ;
165
161
const entity = await this . getById ( id , opts ) ;
166
162
return entity . update ( this . getChangedValues ( update ) ) ;
@@ -179,7 +175,7 @@ export class SequelizeQueryService<Entity extends Model<Entity>>
179
175
* @param update - A `Partial` of entity with the fields to update
180
176
* @param filter - A Filter used to find the records to update
181
177
*/
182
- async updateMany < U extends DeepPartial < Entity > > ( update : U , filter : Filter < Entity > ) : Promise < UpdateManyResponse > {
178
+ async updateMany ( update : DeepPartial < Entity > , filter : Filter < Entity > ) : Promise < UpdateManyResponse > {
183
179
this . ensureIdIsNotPresent ( update ) ;
184
180
const [ count ] = await this . model . update (
185
181
this . getChangedValues ( update ) ,
0 commit comments