Skip to content

Commit

Permalink
avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
thang1160 committed Jul 16, 2020
1 parent 08e0e6f commit 7c98160
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ISCProject/Views/Home/UserPage.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="row">
<div class="col-lg-4 col-sm-4">
<div class="profile-picture ">
<img src="" />
<img src="@profile.Avatar" />
</div>
<img id="upload-profile-btn" src="~/img/Circle-icons-upload.svg.png" />
<img id="loading" src="~/img/LoadingBasketContents.gif" hidden="true" />
Expand Down Expand Up @@ -130,7 +130,7 @@
var uploadProfilePicture = "@Context.Session.GetString("Username")|" + result["data"]["files"][0]["link"]
$.ajax({
url: "@Environment.GetEnvironmentVariable("BaseAPI")" + "ProfilePicture",
dataType: 'json',
dataType: 'string',
method: 'POST',
data: {
uploadProfilePicture: uploadProfilePicture
Expand Down
1 change: 1 addition & 0 deletions ISCProject_API/Controllers/ProfileController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ where a.AccountId.Equals(AccountId)
Username = a.Username,
IsFollowing = a.FollowFollowing.Select(x => x.AccountId).Contains(FollowingId.Value),
AccountId = a.AccountId,
Avatar = a.Avatar
}).FirstOrDefault();

var images = _context.PostImage.Where(x => x.Post.AccountId == AccountId).Select(x => x.Image).ToList();
Expand Down
1 change: 1 addition & 0 deletions ISCProject_Models/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ public class Profile
public string Username { get; set; }
public bool IsFollowing { get; set; }
public int AccountId { get; set; }
public string Avatar { get; set; }
}
}

0 comments on commit 7c98160

Please sign in to comment.