mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
fix(server): require local admin account (#1070)
This commit is contained in:
10
mobile/openapi/doc/UserApi.md
generated
10
mobile/openapi/doc/UserApi.md
generated
@@ -335,7 +335,7 @@ No authorization required
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **getUserCount**
|
||||
> UserCountResponseDto getUserCount()
|
||||
> UserCountResponseDto getUserCount(admin)
|
||||
|
||||
|
||||
|
||||
@@ -344,9 +344,10 @@ No authorization required
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
final api_instance = UserApi();
|
||||
final admin = true; // bool |
|
||||
|
||||
try {
|
||||
final result = api_instance.getUserCount();
|
||||
final result = api_instance.getUserCount(admin);
|
||||
print(result);
|
||||
} catch (e) {
|
||||
print('Exception when calling UserApi->getUserCount: $e\n');
|
||||
@@ -354,7 +355,10 @@ try {
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**admin** | **bool**| | [optional] [default to false]
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
16
mobile/openapi/lib/api/user_api.dart
generated
16
mobile/openapi/lib/api/user_api.dart
generated
@@ -358,7 +358,10 @@ class UserApi {
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /user/count' operation and returns the [Response].
|
||||
Future<Response> getUserCountWithHttpInfo() async {
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [bool] admin:
|
||||
Future<Response> getUserCountWithHttpInfo({ bool? admin, }) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/user/count';
|
||||
|
||||
@@ -369,6 +372,10 @@ class UserApi {
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
if (admin != null) {
|
||||
queryParams.addAll(_queryParams('', 'admin', admin));
|
||||
}
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
@@ -383,8 +390,11 @@ class UserApi {
|
||||
);
|
||||
}
|
||||
|
||||
Future<UserCountResponseDto?> getUserCount() async {
|
||||
final response = await getUserCountWithHttpInfo();
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [bool] admin:
|
||||
Future<UserCountResponseDto?> getUserCount({ bool? admin, }) async {
|
||||
final response = await getUserCountWithHttpInfo( admin: admin, );
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
|
||||
2
mobile/openapi/test/user_api_test.dart
generated
2
mobile/openapi/test/user_api_test.dart
generated
@@ -52,7 +52,7 @@ void main() {
|
||||
// TODO
|
||||
});
|
||||
|
||||
//Future<UserCountResponseDto> getUserCount() async
|
||||
//Future<UserCountResponseDto> getUserCount({ bool admin }) async
|
||||
test('test getUserCount', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user