From 1ecee0c007cbdcfca3767f949dca72098cd332d0 Mon Sep 17 00:00:00 2001 From: Moe Date: Mon, 23 May 2022 01:17:40 +0700 Subject: [PATCH] Fix getsessions api bug --- lib/api/api.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/api/api.dart b/lib/api/api.dart index 4069552..69221b9 100644 --- a/lib/api/api.dart +++ b/lib/api/api.dart @@ -71,8 +71,15 @@ Future resetPost(data) async { } Future getSessions(session) async { - var req = await Dio() - .post('$host/sessions', queryParameters: {'session_token': session}); + var req = await Dio().post( + '$host/sessions', + queryParameters: {'session_token': session}, + options: Options( + validateStatus: (status) { + return status! < 500; + }, + ), + ); return {'statusCode': req.statusCode, 'data': req.data}; }