Load one company

This commit is contained in:
Hillel Coren 2021-04-29 14:40:45 +03:00
parent db7418bff7
commit ef29a94ab8
3 changed files with 7 additions and 5 deletions

View File

@ -2,6 +2,8 @@ class Config {
static const String API_SECRET = 'secret'; static const String API_SECRET = 'secret';
static const String SENTRY_DNS = 'https://634363c8dd6048b8ae89ab6c66dd9c24@sentry.invoicing.co/7'; static const String SENTRY_DNS = 'https://634363c8dd6048b8ae89ab6c66dd9c24@sentry.invoicing.co/7';
static const bool DEBUG_EVENTS = true;
static const bool DEBUG_REQUESTS = false;
static const bool DEMO_MODE = false; static const bool DEMO_MODE = false;
static const String TEST_EMAIL = 'user@example.com'; static const String TEST_EMAIL = 'user@example.com';

View File

@ -69,7 +69,7 @@ class WebClient {
} }
print('POST: $url'); print('POST: $url');
if (!kReleaseMode) { if (!kReleaseMode && Config.DEBUG_REQUESTS) {
printWrapped('Data: $data'); printWrapped('Data: $data');
} }
http.Response response; http.Response response;
@ -117,7 +117,7 @@ class WebClient {
} }
print('PUT: $url'); print('PUT: $url');
if (!kReleaseMode) { if (!kReleaseMode && Config.DEBUG_REQUESTS) {
printWrapped('Data: $data'); printWrapped('Data: $data');
} }
http.Response response; http.Response response;
@ -215,9 +215,9 @@ void _checkResponse(http.Response response) {
debugPrint('response: ${response.statusCode} ${response.body}'); debugPrint('response: ${response.statusCode} ${response.body}');
*/ */
if (!kReleaseMode) { if (!kReleaseMode && Config.DEBUG_REQUESTS) {
printWrapped('${response.statusCode} ${response.body}'); printWrapped('${response.statusCode} ${response.body}');
print('headers: ${response.headers}'); //print('headers: ${response.headers}');
} }
final serverVersion = response.headers['x-app-version']; final serverVersion = response.headers['x-app-version'];

View File

@ -83,7 +83,7 @@ void main({bool isTesting = false}) async {
..addAll(createStoreCompanyGatewaysMiddleware()) ..addAll(createStoreCompanyGatewaysMiddleware())
..addAll(createStoreGroupsMiddleware()) ..addAll(createStoreGroupsMiddleware())
..addAll(createStorePersistenceMiddleware()) ..addAll(createStorePersistenceMiddleware())
..addAll(true || isTesting || kReleaseMode ..addAll(isTesting || kReleaseMode || !Config.DEBUG_EVENTS
? [] ? []
: [ : [
LoggingMiddleware<dynamic>.printer( LoggingMiddleware<dynamic>.printer(