fix: if a field changed, set its changes

This commit is contained in:
Derrick Hammer 2024-03-22 19:34:40 -04:00
parent e3022b8587
commit 8d20659a5b
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 0 deletions

View File

@ -84,22 +84,27 @@ func (i ImportServiceDefault) SaveImport(ctx context.Context, metadata ImportMet
changed := false
if __import.UserID != metadata.UserID {
__import.UserID = metadata.UserID
changed = true
}
if __import.Status != metadata.Status {
__import.Status = metadata.Status
changed = true
}
if __import.Progress != metadata.Progress {
__import.Progress = metadata.Progress
changed = true
}
if __import.Protocol != metadata.Protocol {
__import.Protocol = metadata.Protocol
changed = true
}
if __import.ImporterIP != metadata.ImporterIP {
__import.ImporterIP = metadata.ImporterIP
changed = true
}
if changed {