Merge pull request 'small fixed for build to run' (#468) from SEND048 into main
All checks were successful
ci/woodpecker/push/frontend Pipeline was successful
All checks were successful
ci/woodpecker/push/frontend Pipeline was successful
Reviewed-on: #468
This commit was merged in pull request #468.
This commit is contained in:
@@ -2,8 +2,6 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
|
|
||||||
import 'package:share_plus/share_plus.dart';
|
|
||||||
|
|
||||||
import 'package:pshared/config/constants.dart';
|
import 'package:pshared/config/constants.dart';
|
||||||
import 'package:pshared/models/organization/organization.dart';
|
import 'package:pshared/models/organization/organization.dart';
|
||||||
import 'package:pshared/provider/resource.dart';
|
import 'package:pshared/provider/resource.dart';
|
||||||
@@ -90,55 +88,4 @@ class OrganizationsProvider extends ChangeNotifier {
|
|||||||
// Best-effort cleanup of stored selection to avoid using stale org on next login.
|
// Best-effort cleanup of stored selection to avoid using stale org on next login.
|
||||||
await SecureStorageService.delete(Constants.currentOrgKey);
|
await SecureStorageService.delete(Constants.currentOrgKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Organization> uploadLogo(XFile logoFile) async {
|
|
||||||
if (!isOrganizationSet) {
|
|
||||||
throw StateError('Organization is not set');
|
|
||||||
}
|
|
||||||
|
|
||||||
_setResource(_resource.copyWith(isLoading: true, error: null));
|
|
||||||
try {
|
|
||||||
final updated = await OrganizationService.uploadLogoAndUpdate(current, logoFile);
|
|
||||||
final updatedList = organizations
|
|
||||||
.map((org) => org.id == updated.id ? updated : org)
|
|
||||||
.toList(growable: false);
|
|
||||||
_setResource(Resource(data: updatedList, isLoading: false));
|
|
||||||
_currentOrg = updated.id;
|
|
||||||
return updated;
|
|
||||||
} catch (e) {
|
|
||||||
_setResource(_resource.copyWith(isLoading: false, error: toException(e)));
|
|
||||||
rethrow;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<Organization> updateCurrent({
|
|
||||||
String? name,
|
|
||||||
String? description,
|
|
||||||
String? timeZone,
|
|
||||||
String? logoUrl,
|
|
||||||
}) async {
|
|
||||||
if (!isOrganizationSet) {
|
|
||||||
throw StateError('Organization is not set');
|
|
||||||
}
|
|
||||||
|
|
||||||
_setResource(_resource.copyWith(isLoading: true, error: null));
|
|
||||||
try {
|
|
||||||
final updated = await OrganizationService.updateSettings(
|
|
||||||
current,
|
|
||||||
name: name,
|
|
||||||
description: description,
|
|
||||||
timeZone: timeZone,
|
|
||||||
logoUrl: logoUrl,
|
|
||||||
);
|
|
||||||
final updatedList = organizations
|
|
||||||
.map((org) => org.id == updated.id ? updated : org)
|
|
||||||
.toList(growable: false);
|
|
||||||
_setResource(Resource(data: updatedList, isLoading: false));
|
|
||||||
_currentOrg = updated.id;
|
|
||||||
return updated;
|
|
||||||
} catch (e) {
|
|
||||||
_setResource(_resource.copyWith(isLoading: false, error: toException(e)));
|
|
||||||
rethrow;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,8 +133,4 @@ class MultiQuotationProvider extends ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user