From 67b681d1ddc0c5f7d3a4a489d8b60b672c851db8 Mon Sep 17 00:00:00 2001 From: ZhuangYumin Date: Thu, 14 Dec 2023 04:02:52 +0000 Subject: [PATCH] upd: add check for ISBN before change ISBN --- backend/src/engine.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/src/engine.cpp b/backend/src/engine.cpp index 5a5cacf..d97206f 100644 --- a/backend/src/engine.cpp +++ b/backend/src/engine.cpp @@ -314,6 +314,8 @@ std::vector BookStoreEngineClass::ExecuteMOdify( if (login_stack.top().second == "" || login_stack.top().second == new_ISBN) return std::vector({"Invalid"}); // debugPrint("successfully checked ISBN"); + if (new_ISBN != "" && book_data_base.HaveISBN(new_ISBN)) + return std::vector({"Invalid"}); if (keyword != "") { std::vector key_list; if (!KeyWordSpliter(keyword, key_list, false))