From 09103dc981aa65a7f0622745cb0d72fc2275c0d9 Mon Sep 17 00:00:00 2001 From: Alex Tran Date: Sat, 10 Dec 2022 08:36:21 -0600 Subject: [PATCH] Fixed upsert new DeviceInfo with null isAutoBackup property --- mobile/openapi/README.md | Bin 11576 -> 11576 bytes mobile/openapi/lib/api/device_info_api.dart | Bin 5647 -> 5595 bytes mobile/openapi/test/device_info_api_test.dart | Bin 1053 -> 1023 bytes .../api-v1/device-info/device-info.service.ts | 4 +++- web/src/api/open-api/api.ts | 10 +--------- web/src/api/open-api/base.ts | 2 +- web/src/api/open-api/common.ts | 2 +- web/src/api/open-api/configuration.ts | 2 +- web/src/api/open-api/index.ts | 2 +- 9 files changed, 8 insertions(+), 14 deletions(-) diff --git a/mobile/openapi/README.md b/mobile/openapi/README.md index 76b13b23293861c06028f08e0a1ab7ec91b87697..4b4d076f649d7c65fd94fcb18341c54e48345472 100644 GIT binary patch delta 13 VcmdlHwIgc6OeSNCjkD+K001jA1<(Kh delta 13 VcmdlHwIgc6OeRC~jkD+K001i^1opIjgAkJbYAg6P4G|v`J0F-|b$p8QV delta 79 zcmcbu-LJD@6C)d!f`Y!j{^UH4y_++bikJ|5`N=0ZA}90nNNi4K6=H^pZ_eW|fU$vk Mz-l)0^PJ%X09{=atpET3 diff --git a/mobile/openapi/test/device_info_api_test.dart b/mobile/openapi/test/device_info_api_test.dart index 280f9a3e68d6a63df4bc3915e4d41184d76fbc5d..f7271b8dcae409de148d2d011ef17caf5acfb69b 100644 GIT binary patch delta 20 ccmbQs@t=LeCC15{n9L_jFm-R<#FWhl09hLcxBvhE delta 36 kcmey*K9^&|B}R5G1t8GZpWMS_Kbe!M8^+( diff --git a/server/apps/immich/src/api-v1/device-info/device-info.service.ts b/server/apps/immich/src/api-v1/device-info/device-info.service.ts index b5f3facecd..297224e976 100644 --- a/server/apps/immich/src/api-v1/device-info/device-info.service.ts +++ b/server/apps/immich/src/api-v1/device-info/device-info.service.ts @@ -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); } } diff --git a/web/src/api/open-api/api.ts b/web/src/api/open-api/api.ts index 23559dda5a..1fe7093729 100644 --- a/web/src/api/open-api/api.ts +++ b/web/src/api/open-api/api.ts @@ -4,7 +4,7 @@ * Immich * 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). @@ -4341,7 +4341,6 @@ export const DeviceInfoApiAxiosParamCreator = function (configuration?: Configur return { /** * @deprecated - * @summary * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -4381,7 +4380,6 @@ export const DeviceInfoApiAxiosParamCreator = function (configuration?: Configur }, /** * @deprecated - * @summary * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -4470,7 +4468,6 @@ export const DeviceInfoApiFp = function(configuration?: Configuration) { return { /** * @deprecated - * @summary * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -4481,7 +4478,6 @@ export const DeviceInfoApiFp = function(configuration?: Configuration) { }, /** * @deprecated - * @summary * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -4512,7 +4508,6 @@ export const DeviceInfoApiFactory = function (configuration?: Configuration, bas return { /** * @deprecated - * @summary * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -4522,7 +4517,6 @@ export const DeviceInfoApiFactory = function (configuration?: Configuration, bas }, /** * @deprecated - * @summary * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -4551,7 +4545,6 @@ export const DeviceInfoApiFactory = function (configuration?: Configuration, bas export class DeviceInfoApi extends BaseAPI { /** * @deprecated - * @summary * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -4563,7 +4556,6 @@ export class DeviceInfoApi extends BaseAPI { /** * @deprecated - * @summary * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto * @param {*} [options] Override http request option. * @throws {RequiredError} diff --git a/web/src/api/open-api/base.ts b/web/src/api/open-api/base.ts index cccb44fd05..80827a1d03 100644 --- a/web/src/api/open-api/base.ts +++ b/web/src/api/open-api/base.ts @@ -4,7 +4,7 @@ * Immich * 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). diff --git a/web/src/api/open-api/common.ts b/web/src/api/open-api/common.ts index 528225211b..7eead1834c 100644 --- a/web/src/api/open-api/common.ts +++ b/web/src/api/open-api/common.ts @@ -4,7 +4,7 @@ * Immich * 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). diff --git a/web/src/api/open-api/configuration.ts b/web/src/api/open-api/configuration.ts index d16b363492..d582ee0639 100644 --- a/web/src/api/open-api/configuration.ts +++ b/web/src/api/open-api/configuration.ts @@ -4,7 +4,7 @@ * Immich * 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). diff --git a/web/src/api/open-api/index.ts b/web/src/api/open-api/index.ts index 30725ab46a..dc9b61d191 100644 --- a/web/src/api/open-api/index.ts +++ b/web/src/api/open-api/index.ts @@ -4,7 +4,7 @@ * Immich * 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).