Skip to content

Commit

Permalink
Set date_of_deposit to 0 if state is open
Browse files Browse the repository at this point in the history
  • Loading branch information
ebroda committed Dec 19, 2024
1 parent e822cf9 commit 4996b6c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dao/updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,11 @@ func UpdateDateOfDeposit(ctx context.Context) {
}
for _, entry := range deposits {
updateFilter := bson.D{{Key: "_id", Value: entry.ID}}
update := bson.D{{Key: "date_of_deposit", Value: entry.Modified.Created}}
value := entry.Modified.Created
if entry.Status == "open" {
value = 0
}
update := bson.D{{Key: "date_of_deposit", Value: value}}
if err := DepositCollection.UpdateOne(ctx, updateFilter, vmdb.UpdateSet(update), nil); err != nil {
log.Print(err)
}
Expand Down

0 comments on commit 4996b6c

Please sign in to comment.