Compare commits
No commits in common. "1c229e236f2540f976424677d38b3f2490863ead" and "509bf06128b16c373f92bb64e039cc39a430bed0" have entirely different histories.
1c229e236f
...
509bf06128
@ -158,7 +158,7 @@ void main() async {
|
||||
JobType.values.asNameMap().keys;
|
||||
|
||||
// List<Map<String, List<Map<String, dynamic>>>> this is the real type lol
|
||||
Map<String, dynamic> output = {};
|
||||
List<dynamic> output = [];
|
||||
|
||||
for (int i = 0; i < filters.length; i++) {
|
||||
var postgresResult = (await postgres.query('''
|
||||
@ -176,7 +176,7 @@ void main() async {
|
||||
'''))[0][0];
|
||||
|
||||
if (postgresResult != null) {
|
||||
output.addAll({filters.elementAt(i): postgresResult});
|
||||
output.add({filters.elementAt(i): postgresResult});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -38,20 +38,13 @@ Future fetchBusinessDataOverview() async {
|
||||
var decodedResponse = json.decode(response.body);
|
||||
Map<JobType, List<Business>> groupedBusinesses = {};
|
||||
|
||||
for (String stringType in decodedResponse.keys) {
|
||||
for (int i = 0; i < decodedResponse.length; i++) {
|
||||
groupedBusinesses.addAll({
|
||||
JobType.values.byName(decodedResponse[stringType]):
|
||||
JobType.values.byName(decodedResponse[i]):
|
||||
decodedResponse.map((json) => Business.fromJson(json)).toList()
|
||||
});
|
||||
}
|
||||
|
||||
// for (JobType type in decodedResponse.keys) {
|
||||
// groupedBusinesses.addAll({
|
||||
// JobType.values.byName(decodedResponse[i]):
|
||||
// decodedResponse.map((json) => Business.fromJson(json)).toList()
|
||||
// });
|
||||
// }
|
||||
print(groupedBusinesses);
|
||||
return groupedBusinesses;
|
||||
} else {
|
||||
return 'Error ${response.statusCode}! Please try again later!';
|
||||
|
||||
@ -24,7 +24,6 @@ class _CreateEditBusinessState extends State<CreateEditBusiness> {
|
||||
late TextEditingController _notesController;
|
||||
late TextEditingController _locationNameController;
|
||||
late TextEditingController _locationAddressController;
|
||||
|
||||
Business business = Business(
|
||||
id: 0,
|
||||
name: 'Business',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user