From 3d3e5dc547d77e765d21ada1195533959b6ec368 Mon Sep 17 00:00:00 2001 From: Jin Xuan <87897838+jinxuan-owyong@users.noreply.github.com> Date: Wed, 4 Jun 2025 03:29:11 +0800 Subject: [PATCH] chore(server): cleanup unused query parameters in time bucket (#18893) Co-authored-by: Alex --- mobile/openapi/lib/api/timeline_api.dart | 20 +++----------------- open-api/immich-openapi-specs.json | 18 ------------------ open-api/typescript-sdk/src/fetch-client.ts | 6 +----- server/src/dtos/time-bucket.dto.ts | 12 +----------- 4 files changed, 5 insertions(+), 51 deletions(-) diff --git a/mobile/openapi/lib/api/timeline_api.dart b/mobile/openapi/lib/api/timeline_api.dart index 399e7bde868..33914d5b472 100644 --- a/mobile/openapi/lib/api/timeline_api.dart +++ b/mobile/openapi/lib/api/timeline_api.dart @@ -31,10 +31,6 @@ class TimelineApi { /// /// * [AssetOrder] order: /// - /// * [num] page: - /// - /// * [num] pageSize: - /// /// * [String] personId: /// /// * [String] tagId: @@ -46,7 +42,7 @@ class TimelineApi { /// * [bool] withPartners: /// /// * [bool] withStacked: - Future getTimeBucketWithHttpInfo(String timeBucket, { String? albumId, bool? isFavorite, bool? isTrashed, String? key, AssetOrder? order, num? page, num? pageSize, String? personId, String? tagId, String? userId, AssetVisibility? visibility, bool? withPartners, bool? withStacked, }) async { + Future getTimeBucketWithHttpInfo(String timeBucket, { String? albumId, bool? isFavorite, bool? isTrashed, String? key, AssetOrder? order, String? personId, String? tagId, String? userId, AssetVisibility? visibility, bool? withPartners, bool? withStacked, }) async { // ignore: prefer_const_declarations final apiPath = r'/timeline/bucket'; @@ -72,12 +68,6 @@ class TimelineApi { if (order != null) { queryParams.addAll(_queryParams('', 'order', order)); } - if (page != null) { - queryParams.addAll(_queryParams('', 'page', page)); - } - if (pageSize != null) { - queryParams.addAll(_queryParams('', 'pageSize', pageSize)); - } if (personId != null) { queryParams.addAll(_queryParams('', 'personId', personId)); } @@ -126,10 +116,6 @@ class TimelineApi { /// /// * [AssetOrder] order: /// - /// * [num] page: - /// - /// * [num] pageSize: - /// /// * [String] personId: /// /// * [String] tagId: @@ -141,8 +127,8 @@ class TimelineApi { /// * [bool] withPartners: /// /// * [bool] withStacked: - Future getTimeBucket(String timeBucket, { String? albumId, bool? isFavorite, bool? isTrashed, String? key, AssetOrder? order, num? page, num? pageSize, String? personId, String? tagId, String? userId, AssetVisibility? visibility, bool? withPartners, bool? withStacked, }) async { - final response = await getTimeBucketWithHttpInfo(timeBucket, albumId: albumId, isFavorite: isFavorite, isTrashed: isTrashed, key: key, order: order, page: page, pageSize: pageSize, personId: personId, tagId: tagId, userId: userId, visibility: visibility, withPartners: withPartners, withStacked: withStacked, ); + Future getTimeBucket(String timeBucket, { String? albumId, bool? isFavorite, bool? isTrashed, String? key, AssetOrder? order, String? personId, String? tagId, String? userId, AssetVisibility? visibility, bool? withPartners, bool? withStacked, }) async { + final response = await getTimeBucketWithHttpInfo(timeBucket, albumId: albumId, isFavorite: isFavorite, isTrashed: isTrashed, key: key, order: order, personId: personId, tagId: tagId, userId: userId, visibility: visibility, withPartners: withPartners, withStacked: withStacked, ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } diff --git a/open-api/immich-openapi-specs.json b/open-api/immich-openapi-specs.json index 286fa47c660..de01d7e06a7 100644 --- a/open-api/immich-openapi-specs.json +++ b/open-api/immich-openapi-specs.json @@ -7380,24 +7380,6 @@ "$ref": "#/components/schemas/AssetOrder" } }, - { - "name": "page", - "required": false, - "in": "query", - "schema": { - "minimum": 1, - "type": "number" - } - }, - { - "name": "pageSize", - "required": false, - "in": "query", - "schema": { - "minimum": 1, - "type": "number" - } - }, { "name": "personId", "required": false, diff --git a/open-api/typescript-sdk/src/fetch-client.ts b/open-api/typescript-sdk/src/fetch-client.ts index e3e12dc56ec..3729ccd69fb 100644 --- a/open-api/typescript-sdk/src/fetch-client.ts +++ b/open-api/typescript-sdk/src/fetch-client.ts @@ -3435,14 +3435,12 @@ export function tagAssets({ id, bulkIdsDto }: { body: bulkIdsDto }))); } -export function getTimeBucket({ albumId, isFavorite, isTrashed, key, order, page, pageSize, personId, tagId, timeBucket, userId, visibility, withPartners, withStacked }: { +export function getTimeBucket({ albumId, isFavorite, isTrashed, key, order, personId, tagId, timeBucket, userId, visibility, withPartners, withStacked }: { albumId?: string; isFavorite?: boolean; isTrashed?: boolean; key?: string; order?: AssetOrder; - page?: number; - pageSize?: number; personId?: string; tagId?: string; timeBucket: string; @@ -3460,8 +3458,6 @@ export function getTimeBucket({ albumId, isFavorite, isTrashed, key, order, page isTrashed, key, order, - page, - pageSize, personId, tagId, timeBucket, diff --git a/server/src/dtos/time-bucket.dto.ts b/server/src/dtos/time-bucket.dto.ts index f68ce93075a..3f4157babb9 100644 --- a/server/src/dtos/time-bucket.dto.ts +++ b/server/src/dtos/time-bucket.dto.ts @@ -1,6 +1,6 @@ import { ApiProperty } from '@nestjs/swagger'; -import { IsEnum, IsInt, IsString, Min } from 'class-validator'; +import { IsEnum, IsString } from 'class-validator'; import { AssetOrder, AssetVisibility } from 'src/enum'; import { Optional, ValidateAssetVisibility, ValidateBoolean, ValidateUUID } from 'src/validation'; @@ -41,16 +41,6 @@ export class TimeBucketDto { export class TimeBucketAssetDto extends TimeBucketDto { @IsString() timeBucket!: string; - - @IsInt() - @Min(1) - @Optional() - page?: number; - - @IsInt() - @Min(1) - @Optional() - pageSize?: number; } export class TimelineStackResponseDto {