working profile and editing of profile

This commit is contained in:
erik-sn committed 2020-09-26 16:29:33 -04:00
1 parent 5072a31aab
commit 9fe4cf0188
27 files changed
+459 -51

No files matched your search

+30
View File
@@ -104,3 +104,33 @@ ESX.RegisterServerCallback('phone:getOrCreateTwitterProfile', function(source, c
cb(result)
end)
end)
function updateProfile(identifier, data, cb)
print(identifier)
print(data)
MySQL.Async.execute('UPDATE npwd_twitter_profiles SET avatar_url = @avatar_url, profile_name = @profile_name, bio = @bio, location = @location, job = @job WHERE identifier = @identifier',
{
['identifier'] = identifier,
['avatar_url'] = data.avatar_url,
['profile_name'] = data.profile_name,
['bio'] = data.bio,
['location'] = data.location,
['job'] = data.job,
}, function(result)
print('result1: ', result)
cb(result)
end)
end
ESX.RegisterServerCallback('phone:updateTwitterProfile', function(source, cb, data)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local _identifier = xPlayer.getIdentifier()
updateProfile(_identifier, data, function(result)
print('result2: ', result)
cb(result)
end)
end)