[backend/masto-client] Respect account_id query parameter when searching for notes
This commit is contained in:
parent
ce47377001
commit
faee1e01dc
2 changed files with 3 additions and 2 deletions
|
@ -137,6 +137,7 @@ public class SearchController(
|
|||
.IncludeCommonProperties()
|
||||
.Where(p => p.TextContainsCaseInsensitive(search.Query!) &&
|
||||
(!search.Following || p.User.IsFollowedBy(user)))
|
||||
.FilterByUser(search.UserId)
|
||||
.EnsureVisibleFor(user)
|
||||
.FilterHiddenListMembers(user)
|
||||
.FilterBlocked(user)
|
||||
|
|
|
@ -80,8 +80,8 @@ public static class NoteQueryableExtensions {
|
|||
return query.Where(note => note.User == user);
|
||||
}
|
||||
|
||||
public static IQueryable<Note> FilterByUser(this IQueryable<Note> query, string userId) {
|
||||
return query.Where(note => note.UserId == userId);
|
||||
public static IQueryable<Note> FilterByUser(this IQueryable<Note> query, string? userId) {
|
||||
return userId != null ? query.Where(note => note.UserId == userId) : query;
|
||||
}
|
||||
|
||||
public static IQueryable<Note> EnsureVisibleFor(this IQueryable<Note> query, User? user) {
|
||||
|
|
Loading…
Add table
Reference in a new issue