From d21cd39e9ed9c83f4ba8d6678b9d1f4b9057b3bb Mon Sep 17 00:00:00 2001 From: maxxkim Date: Mon, 4 Mar 2024 14:54:07 +0300 Subject: [PATCH] feat(diary): Encoding error fix for mood --- .../diary/diary_edit_screen/bloc/diary_edit_bloc.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_bloc.dart b/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_bloc.dart index e1844ed9..d73ffe6f 100644 --- a/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_bloc.dart +++ b/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_bloc.dart @@ -210,7 +210,7 @@ class DiaryEditBloc extends Bloc { int diaryID, ) async { String url = - dotenv.env['SERVER_ROOT']! + '/diary/$diaryID/meal/$mealID/fill'; + dotenv.env['SERVER_ROOT']! + '/diary/$diaryID/meal/$mealID/mood/fill'; final Map credentials = { 'mood': selectedMood, }; @@ -222,6 +222,7 @@ class DiaryEditBloc extends Bloc { }, body: json.encode(credentials), encoding: utf8); + print(response.body); return response; } @@ -291,8 +292,11 @@ class DiaryEditBloc extends Bloc { Future sendRetireData( String? token, TimeOfDay retire, int diaryID) async { String url = dotenv.env['SERVER_ROOT']! + '/diary/$diaryID/retire/fill'; + final formatter = DateFormat('HH:mm'); + final retireString = + formatter.format(DateTime(2022, 1, 1, retire.hour, retire.minute)); final Map credentials = { - 'retire': retire, + 'retire': retireString, }; var response = await http.post(Uri.parse(url),