Fixed error add bookmarks
This commit is contained in:
@@ -139,7 +139,7 @@ class BookmarkForm extends _$BookmarkForm {
|
|||||||
ref.read(bookmarksProvider.notifier).refresh();
|
ref.read(bookmarksProvider.notifier).refresh();
|
||||||
ref.watch(routerProvider).pop();
|
ref.watch(routerProvider).pop();
|
||||||
showSnackbar(
|
showSnackbar(
|
||||||
key: ScaffoldMessengerKeys.root,
|
key: ScaffoldMessengerKeys.bookmarks,
|
||||||
label: t.bookmarks.addBookmark.bookmarkSavedSuccessfully,
|
label: t.bookmarks.addBookmark.bookmarkSavedSuccessfully,
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -171,7 +171,10 @@ class ApiClientService {
|
|||||||
"/bookmarks/",
|
"/bookmarks/",
|
||||||
data: FormData.fromMap(bookmark.toJson()),
|
data: FormData.fromMap(bookmark.toJson()),
|
||||||
);
|
);
|
||||||
if (response.statusCode != 200) {
|
if (response.statusCode == null) {
|
||||||
|
return const ApiResponse(successful: false);
|
||||||
|
}
|
||||||
|
if (response.statusCode! >= 400) {
|
||||||
return const ApiResponse(successful: false);
|
return const ApiResponse(successful: false);
|
||||||
}
|
}
|
||||||
return ApiResponse(
|
return ApiResponse(
|
||||||
|
|||||||
Reference in New Issue
Block a user