File tree Expand file tree Collapse file tree 4 files changed +7
-15
lines changed Expand file tree Collapse file tree 4 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,9 @@ const enrolmentsHandler = async (enrolments: SisuEnrolment[]) => {
41
41
ignoreDuplicates : true ,
42
42
} ,
43
43
fallbackCreateOptions : {
44
- conflictFields : [ 'user_id' , 'chat_instanceId ' ] ,
44
+ conflictFields : [ 'user_id' , 'chat_instance_id ' ] ,
45
45
fields : [ 'user_id' , 'chat_instance_id' ] ,
46
- returning : false ,
47
- }
46
+ } ,
48
47
} )
49
48
}
50
49
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { fetchUsers } from './users'
6
6
import { clearOffsets } from './util'
7
7
8
8
const runUpdater = async ( ) => {
9
- // await fetchUsers()
9
+ await fetchUsers ( )
10
10
await fetchCoursesAndResponsibilities ( )
11
11
await fetchEnrolments ( )
12
12
}
Original file line number Diff line number Diff line change @@ -85,8 +85,7 @@ export const upsertResponsibilities = async (
85
85
fallbackCreateOptions : {
86
86
conflictFields : [ 'user_id' , 'chat_instance_id' ] ,
87
87
fields : [ 'user_id' , 'chat_instance_id' ] ,
88
- returning : false ,
89
- }
88
+ } ,
90
89
} )
91
90
92
91
await t . commit ( )
Original file line number Diff line number Diff line change @@ -15,9 +15,7 @@ type AllowedBulkCreateOptionField =
15
15
| 'conflictAttributes'
16
16
| 'updateOnDuplicate'
17
17
| 'ignoreDuplicates'
18
- type AllowedFallbackCreateOptionField =
19
- | 'fields'
20
- | 'conflictFields'
18
+ type AllowedFallbackCreateOptionField = 'fields' | 'conflictFields'
21
19
22
20
interface BulkCreateOptions {
23
21
entityName : string
@@ -36,9 +34,7 @@ export const safeBulkCreate = async ({
36
34
entities,
37
35
} : BulkCreateOptions ) => {
38
36
try {
39
- const result = await bulkCreate ( entities , {
40
- ...bulkCreateOptions ,
41
- } )
37
+ const result = await bulkCreate ( entities , bulkCreateOptions )
42
38
return result
43
39
} catch ( bulkCreateError : any ) {
44
40
const result = [ ]
@@ -50,9 +46,7 @@ export const safeBulkCreate = async ({
50
46
for ( const entity of entities ) {
51
47
try {
52
48
// eslint-disable-next-line no-await-in-loop
53
- const res = await fallbackCreate ( entity , {
54
- ...fallbackCreateOptions ,
55
- } )
49
+ const res = await fallbackCreate ( entity , fallbackCreateOptions )
56
50
result . push ( res )
57
51
} catch ( fallbackCreateError : any ) {
58
52
logError (
You can’t perform that action at this time.
0 commit comments