7
7
type ResourceShape ,
8
8
} from '~/common' ;
9
9
import { type DbChanges } from '../../changes' ;
10
- import { apoc , collect , merge , type Variable , variable } from '../index' ;
10
+ import { apoc , collect , merge , Variable , variable } from '../index' ;
11
11
import { type PropUpdateStat , updateProperty } from './update-property' ;
12
12
13
13
export interface UpdatePropertiesOptions <
@@ -21,6 +21,7 @@ export interface UpdatePropertiesOptions<
21
21
changeset ?: Variable ;
22
22
nodeName ?: string ;
23
23
outputStatsVar ?: string ;
24
+ now ?: DateTime | Variable ;
24
25
}
25
26
26
27
export const updateProperties =
@@ -35,6 +36,7 @@ export const updateProperties =
35
36
changeset,
36
37
nodeName = 'node' ,
37
38
outputStatsVar = 'stats' ,
39
+ now,
38
40
} : UpdatePropertiesOptions < TResourceStatic , TObject > ) =>
39
41
< R > ( query : Query < R > ) => {
40
42
const resource = EnhancedResource . of ( resourceIn ) ;
@@ -61,7 +63,10 @@ export const updateProperties =
61
63
labels : variable ( 'prop.labels' ) ,
62
64
changeset,
63
65
nodeName,
64
- now : query . params . addParam ( DateTime . local ( ) , 'now' ) ,
66
+ now :
67
+ now instanceof Variable
68
+ ? now
69
+ : query . params . addParam ( now ?? DateTime . local ( ) , 'now' ) ,
65
70
} ) ,
66
71
)
67
72
. return < {
0 commit comments