1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-25 10:43:13 +02:00

Fixed upsert new DeviceInfo with null isAutoBackup property

This commit is contained in:
Alex Tran 2022-12-10 08:36:21 -06:00
parent f096910abc
commit 09103dc981
No known key found for this signature in database
GPG Key ID: E4954BC787B85C8A
9 changed files with 8 additions and 14 deletions

BIN
mobile/openapi/README.md generated

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -18,12 +18,14 @@ export class DeviceInfoService {
const exists = await this.repository.findOne({ where: { userId, deviceId } }); const exists = await this.repository.findOne({ where: { userId, deviceId } });
if (!exists) { if (!exists) {
if (!entity.isAutoBackup) {
entity.isAutoBackup = false;
}
return await this.repository.save(entity); return await this.repository.save(entity);
} }
exists.isAutoBackup = entity.isAutoBackup ?? exists.isAutoBackup; exists.isAutoBackup = entity.isAutoBackup ?? exists.isAutoBackup;
exists.deviceType = entity.deviceType ?? exists.deviceType; exists.deviceType = entity.deviceType ?? exists.deviceType;
return await this.repository.save(exists); return await this.repository.save(exists);
} }
} }

View File

@ -4,7 +4,7 @@
* Immich * Immich
* Immich API * Immich API
* *
* The version of the OpenAPI document: 1.17.0 * The version of the OpenAPI document: 1.38.0
* *
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -4341,7 +4341,6 @@ export const DeviceInfoApiAxiosParamCreator = function (configuration?: Configur
return { return {
/** /**
* @deprecated * @deprecated
* @summary
* @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
@ -4381,7 +4380,6 @@ export const DeviceInfoApiAxiosParamCreator = function (configuration?: Configur
}, },
/** /**
* @deprecated * @deprecated
* @summary
* @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
@ -4470,7 +4468,6 @@ export const DeviceInfoApiFp = function(configuration?: Configuration) {
return { return {
/** /**
* @deprecated * @deprecated
* @summary
* @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
@ -4481,7 +4478,6 @@ export const DeviceInfoApiFp = function(configuration?: Configuration) {
}, },
/** /**
* @deprecated * @deprecated
* @summary
* @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
@ -4512,7 +4508,6 @@ export const DeviceInfoApiFactory = function (configuration?: Configuration, bas
return { return {
/** /**
* @deprecated * @deprecated
* @summary
* @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
@ -4522,7 +4517,6 @@ export const DeviceInfoApiFactory = function (configuration?: Configuration, bas
}, },
/** /**
* @deprecated * @deprecated
* @summary
* @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
@ -4551,7 +4545,6 @@ export const DeviceInfoApiFactory = function (configuration?: Configuration, bas
export class DeviceInfoApi extends BaseAPI { export class DeviceInfoApi extends BaseAPI {
/** /**
* @deprecated * @deprecated
* @summary
* @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
@ -4563,7 +4556,6 @@ export class DeviceInfoApi extends BaseAPI {
/** /**
* @deprecated * @deprecated
* @summary
* @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}

View File

@ -4,7 +4,7 @@
* Immich * Immich
* Immich API * Immich API
* *
* The version of the OpenAPI document: 1.17.0 * The version of the OpenAPI document: 1.38.0
* *
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -4,7 +4,7 @@
* Immich * Immich
* Immich API * Immich API
* *
* The version of the OpenAPI document: 1.17.0 * The version of the OpenAPI document: 1.38.0
* *
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -4,7 +4,7 @@
* Immich * Immich
* Immich API * Immich API
* *
* The version of the OpenAPI document: 1.17.0 * The version of the OpenAPI document: 1.38.0
* *
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -4,7 +4,7 @@
* Immich * Immich
* Immich API * Immich API
* *
* The version of the OpenAPI document: 1.17.0 * The version of the OpenAPI document: 1.38.0
* *
* *
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).