Fixed error if no requests

This commit is contained in:
a-ill 2023-08-02 18:15:50 +03:00
parent 241f0e34e2
commit d15dca1d8e

View File

@ -248,6 +248,7 @@ end
function add_verified_groups() function add_verified_groups()
groups_create_requests_verified = select_from_table("groups_requests" => ["*"], where_data = ["group_id" => nothing, "status" => 1]) groups_create_requests_verified = select_from_table("groups_requests" => ["*"], where_data = ["group_id" => nothing, "status" => 1])
data = Dict(zip(names(groups_create_requests_verified),groups_create_requests_verified[end,:])) data = Dict(zip(names(groups_create_requests_verified),groups_create_requests_verified[end,:]))
if size(data,1)!=0
user_id = data["user_id"] user_id = data["user_id"]
delete!(data,"group_id") delete!(data,"group_id")
delete!(data,"user_id") delete!(data,"user_id")
@ -257,6 +258,7 @@ function add_verified_groups()
dict_users_groups = Dict("user_id" => user_id, "group_id" => group_id) dict_users_groups = Dict("user_id" => user_id, "group_id" => group_id)
insert_into_table("users_groups",dict_users_groups) insert_into_table("users_groups",dict_users_groups)
delete_from_table("groups_requests",["user_id" => user_id]) delete_from_table("groups_requests",["user_id" => user_id])
end
compile("groups") compile("groups")
end end