Fixed error add bookmarks

This commit is contained in:
Juan Gilsanz Polo
2024-04-06 14:59:11 +02:00
parent 01e05098d0
commit a90f47cd5c
2 changed files with 5 additions and 2 deletions

View File

@@ -139,7 +139,7 @@ class BookmarkForm extends _$BookmarkForm {
ref.read(bookmarksProvider.notifier).refresh();
ref.watch(routerProvider).pop();
showSnackbar(
key: ScaffoldMessengerKeys.root,
key: ScaffoldMessengerKeys.bookmarks,
label: t.bookmarks.addBookmark.bookmarkSavedSuccessfully,
color: Colors.green,
);

View File

@@ -171,7 +171,10 @@ class ApiClientService {
"/bookmarks/",
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 ApiResponse(