[backend/api] Improve remote emoji query
This commit is contained in:
parent
805812110a
commit
026cfa0e82
1 changed files with 2 additions and 4 deletions
|
@ -59,10 +59,8 @@ public class EmojiController(
|
||||||
{
|
{
|
||||||
var res = await db.Emojis
|
var res = await db.Emojis
|
||||||
.Where(p => p.Host != null
|
.Where(p => p.Host != null
|
||||||
&& (!string.IsNullOrWhiteSpace(host) && p.Host.ToLower().Contains(host.ToLower())
|
&& (string.IsNullOrWhiteSpace(host) || p.Host.ToLower().Contains(host.ToLower()))
|
||||||
|| string.IsNullOrWhiteSpace(host))
|
&& (string.IsNullOrWhiteSpace(name) || p.Name.ToLower().Contains(name.ToLower())))
|
||||||
&& (!string.IsNullOrWhiteSpace(name) && p.Name.ToLower().Contains(name.ToLower())
|
|
||||||
|| string.IsNullOrWhiteSpace(name)))
|
|
||||||
.Select(p => new EmojiResponse
|
.Select(p => new EmojiResponse
|
||||||
{
|
{
|
||||||
Id = p.Id,
|
Id = p.Id,
|
||||||
|
|
Loading…
Add table
Reference in a new issue