mirror of
https://github.com/yawaflua/SpCloudCore.git
synced 2025-12-09 20:19:35 +02:00
add null checks for delete and update
This commit is contained in:
@@ -102,6 +102,13 @@ int main()
|
|||||||
|
|
||||||
std::string name = req.get_file_value("Name").content;
|
std::string name = req.get_file_value("Name").content;
|
||||||
|
|
||||||
|
if (name.empty() || name == " ")
|
||||||
|
{
|
||||||
|
res.set_content("Select another app name", "text/plain");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::string authorization_token = req.get_header_value("Authorization");
|
std::string authorization_token = req.get_header_value("Authorization");
|
||||||
|
|
||||||
string is_user_banned = mongo_service.is_user_banned(authorization_token);
|
string is_user_banned = mongo_service.is_user_banned(authorization_token);
|
||||||
@@ -139,6 +146,13 @@ int main()
|
|||||||
|
|
||||||
std::string name = req.get_file_value("Name").content;
|
std::string name = req.get_file_value("Name").content;
|
||||||
|
|
||||||
|
if (name.empty() || name == " ")
|
||||||
|
{
|
||||||
|
res.set_content("Select another app name", "text/plain");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::string authorization_token = req.get_header_value("Authorization");
|
std::string authorization_token = req.get_header_value("Authorization");
|
||||||
|
|
||||||
string is_user_banned = mongo_service.is_user_banned(authorization_token);
|
string is_user_banned = mongo_service.is_user_banned(authorization_token);
|
||||||
|
|||||||
Reference in New Issue
Block a user