Semi Final 7th Aug 2024

This commit is contained in:
2024-08-07 14:24:05 +09:00
parent 66ade1fe09
commit 347861e5a1
23 changed files with 342 additions and 160 deletions

View File

@ -363,7 +363,7 @@ class ApiService extends GetxService{
}),
);
if (response.statusCode == 201) {
if (response.statusCode == 200 || response.statusCode == 201) {
final decodedResponse = utf8.decode(response.bodyBytes);
return User.fromJson(json.decode(decodedResponse));
} else {
@ -511,6 +511,8 @@ class ApiService extends GetxService{
return Entry.fromJson(json.decode(decodedResponse));
} else {
final decodedResponse = utf8.decode(response.bodyBytes);
print("decodedResponse = $decodedResponse");
throw Exception('Failed to create entry');
}
}
@ -552,7 +554,7 @@ class ApiService extends GetxService{
}
Future<Entry> updateEntry(int entryId, int teamId, int eventId, int categoryId, DateTime date) async {
Future<Entry> updateEntry(int entryId, int teamId, int eventId, int categoryId, DateTime date,int zekken_number) async {
init();
getToken();
@ -572,6 +574,7 @@ class ApiService extends GetxService{
'event': eventId,
'category': categoryId,
'date': formattedDate,
'zekken_number': zekken_number,
}),
);
@ -580,6 +583,9 @@ class ApiService extends GetxService{
return Entry.fromJson(json.decode(decodedResponse));
} else {
final decodedResponse = utf8.decode(response.bodyBytes);
final blk = json.decode(decodedResponse);
throw Exception('Failed to update entry');
}
}