Migrate to new follows storage

This commit is contained in:
2019-11-19 13:51:54 +09:00
parent 99f5ae1b4f
commit 803d303420
14 changed files with 237 additions and 241 deletions

View File

@ -120,7 +120,7 @@ func Profile(ctx aero.Context, viewUser *arn.User) error {
}
// Friends
friends := viewUser.Follows().UsersWhoFollowBack()
friends := viewUser.Friends()
arn.SortUsersFollowers(friends)

View File

@ -141,12 +141,12 @@ component ProfileHead(viewUser *arn.User, animeList *arn.AnimeList, user *arn.Us
.profile-actions
if user != nil && user.ID != viewUser.ID
if !user.Follows().Contains(viewUser.ID)
button.profile-action.action.mountable.never-unmount(data-action="followUser", data-trigger="click", data-api="/api/userfollows/" + user.ID + "/add/" + viewUser.ID)
if !user.IsFollowing(viewUser.ID)
button.profile-action.action.mountable.never-unmount(data-action="followUser", data-trigger="click", data-api="/api/user/" + user.ID + "/follow/" + viewUser.ID)
Icon("user-plus")
span Follow
else
button.profile-action.action.mountable.never-unmount(data-action="unfollowUser", data-trigger="click", data-api="/api/userfollows/" + user.ID + "/remove/" + viewUser.ID)
button.profile-action.action.mountable.never-unmount(data-action="unfollowUser", data-trigger="click", data-api="/api/user/" + user.ID + "/unfollow/" + viewUser.ID)
Icon("user-times")
span Unfollow