Add prompt marketplace interactions and profile prompt tabs
This commit is contained in:
1 parent
691bc72681
commit
c95319b1fe
20 files changed
+734
-146
No files matched your search
@@ -44,7 +44,9 @@ namespace OnlyPrompt.Backend.Controllers
|
||||
|
||||
query = sortBy switch {
|
||||
FeedSortType.Date => query.OrderBy(x => x.UpdatedAt, ascending),
|
||||
FeedSortType.Rating => query.OrderBy(x => x.Reviews.Average(r => (double?)r.Rating) ?? 2.5, ascending),
|
||||
FeedSortType.Rating => ascending
|
||||
? query.OrderBy(x => x.Likes.Count).ThenBy(x => x.Reviews.Average(r => (double?)r.Rating) ?? 0)
|
||||
: query.OrderByDescending(x => x.Likes.Count).ThenByDescending(x => x.Reviews.Average(r => (double?)r.Rating) ?? 0),
|
||||
_ => query
|
||||
};
|
||||
|
||||
@@ -60,6 +62,11 @@ namespace OnlyPrompt.Backend.Controllers
|
||||
x.Creator.Profile.DisplayName,
|
||||
x.Creator.Profile.AvatarUrl,
|
||||
x.ExampleImageUrl,
|
||||
x.Price,
|
||||
x.Likes.Count,
|
||||
x.Likes.Any(l => l.UserId == userId),
|
||||
x.Saves.Count,
|
||||
x.Saves.Any(s => s.UserId == userId),
|
||||
x.SubscriptionTier == null ? (int?)null : x.SubscriptionTier.Level,
|
||||
x.SubscriptionTier == null ? null : x.SubscriptionTier.Name,
|
||||
x.Reviews.Average(r => (double?)r.Rating),
|
||||
|
||||
Reference in new issue
Block a user