mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
Fixed upsert new DeviceInfo with null isAutoBackup property
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user