File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -630,6 +630,19 @@ func CreateArtifactPullLogEntry(
630630 if remoteAddress == "" {
631631 remoteAddressPtr = nil
632632 }
633+
634+ args := pgx.NamedArgs {
635+ "versionId" : versionID ,
636+ "remoteAddress" : remoteAddressPtr ,
637+ "customerOrgId" : customerOrgID ,
638+ }
639+
640+ if userID != uuid .Nil {
641+ args ["userId" ] = userID
642+ } else {
643+ args ["userId" ] = nil
644+ }
645+
633646 _ , err := db .Exec (
634647 ctx ,
635648 `INSERT INTO ArtifactVersionPull (
@@ -644,12 +657,7 @@ func CreateArtifactPullLogEntry(
644657 @remoteAddress,
645658 @customerOrgId
646659 )` ,
647- pgx.NamedArgs {
648- "versionId" : versionID ,
649- "userId" : userID ,
650- "remoteAddress" : remoteAddressPtr ,
651- "customerOrgId" : customerOrgID ,
652- },
660+ args ,
653661 )
654662 if err != nil {
655663 return fmt .Errorf ("could not create artifact pull log entry: %w" , err )
You can’t perform that action at this time.
0 commit comments