Skip to content

Commit

Permalink
Merge pull request #40 from fga-eps-mds/hotfix/38-homepage-nao-mostra…
Browse files Browse the repository at this point in the history
…ndo-anuncios

#38 Altreação da rota incorreta
  • Loading branch information
Joao-Moura authored Apr 23, 2021
2 parents db24bf0 + 19def04 commit 342c149
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
4 changes: 2 additions & 2 deletions hortum_mobile/lib/data/prod_log_data_backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ProdLoggedAnnounDataApi {

Future getAnnounProd() async {
String encodedEmail = encodeString(actualUser.email);
String url = 'http://$ip:8000/productor/retrieve/${encodedEmail}';
String url = 'http://$ip:8000/announcement/retrieve/${encodedEmail}';

var header = {
"Content-Type": "application/json",
Expand All @@ -26,7 +26,7 @@ class ProdLoggedAnnounDataApi {
Response response =
await this.dio.get(url, options: Options(headers: header));

this.announcements = response.data['announcements'];
this.announcements = response.data;
manipulateData();
}

Expand Down
29 changes: 13 additions & 16 deletions hortum_mobile/test/home_productor_page_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,19 @@ main() {
TestWidgetsFlutterBinding.ensureInitialized();
final dioMock = DioMock();

dynamic response = {
"username": "Usuário Teste",
"email": "usuá[email protected]",
"idPicture": null,
"announcements": [
{
"username": "Usuário Teste",
"idPictureProductor": null,
"name": "Folha Verde",
"type_of_product": "Alface",
"description": "Alface plantado na fazenda",
"price": 5.0,
"idPicture": null
}
]
};
List<dynamic> response = [
{
"email": "usuá[email protected]",
"username": "Usuário Teste",
"idPictureProductor": null,
"name": "Folha Verde",
"type_of_product": "Alface",
"description": "Alface plantado na fazenda",
"price": 5.0,
"idPicture": null,
"likes": 0
},
];

Widget makeTestable() {
return MaterialApp(
Expand Down

0 comments on commit 342c149

Please sign in to comment.