hopefully fix /Manage/SetAvatar

This commit is contained in:
Michael 2017-05-18 19:59:47 -04:00
parent cc107c23d0
commit 7805d69917

View file

@ -23,7 +23,8 @@ public ManageController()
public ActionResult SetAvatar(string id)
{
var db = new ApplicationDbContext();
var usr = db.Users.FirstOrDefault(x => x.Id == User.Identity.GetUserId());
string uid = User.Identity.GetUserId();
var usr = db.Users.FirstOrDefault(x => x.Id == uid);
var avtr = db.UserAvatars.FirstOrDefault(x => x.Id == id);
usr.AvatarUrl = avtr.AvatarUrl;
db.SaveChanges();