mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Fixed upsert new DeviceInfo with null isAutoBackup property
This commit is contained in:
parent
f096910abc
commit
09103dc981
9 changed files with 9 additions and 27 deletions
|
|
@ -18,12 +18,14 @@ export class DeviceInfoService {
|
|||
const exists = await this.repository.findOne({ where: { userId, deviceId } });
|
||||
|
||||
if (!exists) {
|
||||
if (!entity.isAutoBackup) {
|
||||
entity.isAutoBackup = false;
|
||||
}
|
||||
return await this.repository.save(entity);
|
||||
}
|
||||
|
||||
exists.isAutoBackup = entity.isAutoBackup ?? exists.isAutoBackup;
|
||||
exists.deviceType = entity.deviceType ?? exists.deviceType;
|
||||
|
||||
return await this.repository.save(exists);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue