From 0d6cce4a5b6fca50d011a388f9c720a226c4fd5c Mon Sep 17 00:00:00 2001 From: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> Date: Fri, 29 May 2026 03:14:11 +0530 Subject: [PATCH] fix: api repositories using stale endpoint (#28667) Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> --- mobile/lib/services/api.service.dart | 4 ++-- mobile/openapi/lib/api_client.dart | 2 +- open-api/patch/api_client.dart.patch | 9 +++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/mobile/lib/services/api.service.dart b/mobile/lib/services/api.service.dart index 99f618b832..b6a2cb1e4b 100644 --- a/mobile/lib/services/api.service.dart +++ b/mobile/lib/services/api.service.dart @@ -13,7 +13,7 @@ import 'package:logging/logging.dart'; import 'package:openapi/api.dart'; class ApiService { - late ApiClient _apiClient; + final ApiClient _apiClient = ApiClient(basePath: ''); late UsersApi usersApi; late AuthenticationApi authenticationApi; @@ -54,7 +54,7 @@ class ApiService { } setEndpoint(String endpoint) { - _apiClient = ApiClient(basePath: endpoint); + _apiClient.basePath = endpoint; _apiClient.client = NetworkRepository.client; usersApi = UsersApi(_apiClient); authenticationApi = AuthenticationApi(_apiClient); diff --git a/mobile/openapi/lib/api_client.dart b/mobile/openapi/lib/api_client.dart index a3c2369c1d..fd0d73aebb 100644 --- a/mobile/openapi/lib/api_client.dart +++ b/mobile/openapi/lib/api_client.dart @@ -13,7 +13,7 @@ part of openapi.api; class ApiClient { ApiClient({this.basePath = '/api', this.authentication,}); - final String basePath; + String basePath; final Authentication? authentication; var _client = Client(); diff --git a/open-api/patch/api_client.dart.patch b/open-api/patch/api_client.dart.patch index 8996e79413..a813c1c033 100644 --- a/open-api/patch/api_client.dart.patch +++ b/open-api/patch/api_client.dart.patch @@ -1,3 +1,12 @@ +@@ -13,7 +13,7 @@ + class ApiClient { + ApiClient({this.basePath = '/api', this.authentication,}); + +- final String basePath; ++ String basePath; + final Authentication? authentication; + + var _client = Client(); @@ -143,19 +143,19 @@ ); }