This commit is contained in:
Hillel Coren 2020-03-06 10:11:34 +02:00
parent e87065613c
commit 9de2e83101
16 changed files with 27 additions and 27 deletions

View File

@ -75,7 +75,7 @@ class CompanyGatewayRepository {
var url = credentials.url +
'/company_gateways/${companyGateway.id}?include=gateway';
if (action != null) {
url += '?action=' + action.toString();
url += '&action=' + action.toString();
}
response =
await webClient.put(url, credentials.token, data: json.encode(data));

View File

@ -69,7 +69,7 @@ class CreditRepository {
} else {
var url = '${credentials.url}/credits/${credit.id}?';
if (action != null) {
url += '?action=' + action.toString();
url += '&action=$action';
}
response =
await webClient.put(url, credentials.token, data: json.encode(data));

View File

@ -67,9 +67,9 @@ class DesignRepository {
credentials.url + '/designs', credentials.token,
data: json.encode(data));
} else {
var url = credentials.url + '/designs/' + design.id.toString();
var url = credentials.url + '/designs/${design.id}?';
if (action != null) {
url += '?action=' + action.toString();
url += '&action=' + action.toString();
}
response =
await webClient.put(url, credentials.token, data: json.encode(data));

View File

@ -76,12 +76,12 @@ class DocumentRepository {
} else {
final data =
serializers.serializeWith(DocumentEntity.serializer, document);
var url = '${credentials.url}/documents/${document.id}';
var url = '${credentials.url}/documents/${document.id}?';
if (action == EntityAction.delete) {
response = await webClient.delete(url, credentials.token);
} else {
if (action != null) {
url += '?action=' + action.toString();
url += '&action=$action';
}
response = await webClient.put(url, credentials.token,
data: json.encode(data));

View File

@ -67,9 +67,9 @@ class ExpenseRepository {
credentials.url + '/expenses', credentials.token,
data: json.encode(data));
} else {
var url = credentials.url + '/expenses/' + expense.id.toString();
var url = credentials.url + '/expenses/${expense.id}?';
if (action != null) {
url += '?action=' + action.toString();
url += '&action=' + action.toString();
}
response =
await webClient.put(url, credentials.token, data: json.encode(data));

View File

@ -67,9 +67,9 @@ class GroupRepository {
credentials.url + '/group_settings', credentials.token,
data: json.encode(data));
} else {
var url = credentials.url + '/group_settings/' + group.id.toString();
var url = credentials.url + '/group_settings/${group.id}?';
if (action != null) {
url += '?action=' + action.toString();
url += '&action=$action';
}
response =
await webClient.put(url, credentials.token, data: json.encode(data));

View File

@ -46,7 +46,7 @@ class InvoiceRepository {
Credentials credentials, List<String> ids, EntityAction action) async {
var url = credentials.url + '/invoices/bulk?';
if (action != null) {
url += '&action=' + action.toString();
url += 'action=' + action.toString();
}
final dynamic response = await webClient.post(url, credentials.token,
data: json.encode({'ids': ids}));

View File

@ -56,9 +56,9 @@ class ProductRepository {
credentials.url + '/products', credentials.token,
data: json.encode(data));
} else {
var url = credentials.url + '/products/' + product.id.toString();
var url = credentials.url + '/products/${product.id}?';
if (action != null) {
url += '?action=' + action.toString();
url += '&action=' + action.toString();
}
response =
await webClient.put(url, credentials.token, data: json.encode(data));

View File

@ -67,9 +67,9 @@ class ProjectRepository {
credentials.url + '/projects', credentials.token,
data: json.encode(data));
} else {
var url = credentials.url + '/projects/' + project.id.toString();
var url = credentials.url + '/projects/${project.id}?';
if (action != null) {
url += '?action=' + action.toString();
url += '&action=' + action.toString();
}
response =
await webClient.put(url, credentials.token, data: json.encode(data));

View File

@ -69,7 +69,7 @@ class QuoteRepository {
} else {
var url = '${credentials.url}/quotes/${quote.id}?';
if (action != null) {
url += '?action=' + action.toString();
url += '&action=' + action.toString();
}
response =
await webClient.put(url, credentials.token, data: json.encode(data));

View File

@ -72,9 +72,9 @@ class TaskRepository {
credentials.url + '/tasks', credentials.token,
data: json.encode(data));
} else {
var url = credentials.url + '/tasks/' + task.id.toString();
var url = credentials.url + '/tasks/${task.id}?';
if (action != null) {
url += '?action=' + action.toString();
url += '&action=' + action.toString();
}
response =
await webClient.put(url, credentials.token, data: json.encode(data));

View File

@ -67,9 +67,9 @@ class TaxRateRepository {
credentials.url + '/tax_rates', credentials.token,
data: json.encode(data));
} else {
var url = credentials.url + '/tax_rates/' + taxRate.id.toString();
var url = credentials.url + '/tax_rates/${taxRate.id}?';
if (action != null) {
url += '?action=' + action.toString();
url += '&action=$action';
}
response =
await webClient.put(url, credentials.token, data: json.encode(data));

View File

@ -83,9 +83,9 @@ class UserRepository {
);
} else {
var url = credentials.url +
'/users/${user.id}?include=company_user&password=$password';
'/users/${user.id}?include=company_user';
if (action != null) {
url += '?action=' + action.toString();
url += '&action=$action';
}
response = await webClient.put(
url,

View File

@ -67,9 +67,9 @@ class VendorRepository {
credentials.url + '/vendors', credentials.token,
data: json.encode(data));
} else {
var url = credentials.url + '/vendors/' + vendor.id.toString();
var url = credentials.url + '/vendors/${vendor.id}?';
if (action != null) {
url += '?action=' + action.toString();
url += '&action=' + action.toString();
}
response =
await webClient.put(url, credentials.token, data: json.encode(data));

View File

@ -503,7 +503,7 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
//return 'Currency Map: ${staticState.currencyMap}';
//return 'History: $historyList';
//return 'Use inclusive: ${invoiceUIState.editing.usesInclusiveTaxes}';
//return 'Invitations: ${invoiceUIState.editing.invitations}';
return 'Invitations: ${invoiceUIState.editing.invitations}';
//return 'Token: ${userCompanyStates.map((state) => state.token.token).where((name) => name.isNotEmpty).toList().join(', ')}';
//return 'Settings: ${company.settings.companyLogo}';
//return 'Designs: ${company.designs}';

View File

@ -72,9 +72,9 @@ class StubRepository {
credentials.token,
data: json.encode(data));
} else {
var url = credentials.url + '/stubs/' + stub.id.toString();
var url = '${credentials.url}/stubs/${stub.id}?';
if (action != null) {
url += '?action=' + action.toString();
url += '&action=$action';
}
response = await webClient.put(url, credentials.token, data: json.encode(data));
}