mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 08:53:48 +01:00
Format
This commit is contained in:
parent
c6d10e705a
commit
b560145259
@ -107,7 +107,9 @@ export default define(meta, paramDef, async (ps) => {
|
||||
}
|
||||
|
||||
if (ps.query) {
|
||||
q.andWhere('emoji.name like :query', { query: `%${sqlLikeEscape(ps.query)}%` });
|
||||
q.andWhere("emoji.name like :query", {
|
||||
query: `%${sqlLikeEscape(ps.query)}%`,
|
||||
});
|
||||
}
|
||||
|
||||
const emojis = await q.orderBy("emoji.id", "DESC").take(ps.limit).getMany();
|
||||
|
@ -32,7 +32,9 @@ export const paramDef = {
|
||||
|
||||
export default define(meta, paramDef, async (ps) => {
|
||||
const hashtags = await Hashtags.createQueryBuilder("tag")
|
||||
.where("tag.name like :q", { q: `${sqlLikeEscape(ps.query.toLowerCase())}%` })
|
||||
.where("tag.name like :q", {
|
||||
q: `${sqlLikeEscape(ps.query.toLowerCase())}%`,
|
||||
})
|
||||
.orderBy("tag.count", "DESC")
|
||||
.groupBy("tag.id")
|
||||
.take(ps.limit)
|
||||
|
@ -45,7 +45,9 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||
if (ps.host) {
|
||||
const q = Users.createQueryBuilder("user")
|
||||
.where("user.isSuspended = FALSE")
|
||||
.andWhere("user.host LIKE :host", { host: `${sqlLikeEscape(ps.host.toLowerCase())}%` });
|
||||
.andWhere("user.host LIKE :host", {
|
||||
host: `${sqlLikeEscape(ps.host.toLowerCase())}%`,
|
||||
});
|
||||
|
||||
if (ps.username) {
|
||||
q.andWhere("user.usernameLower LIKE :username", {
|
||||
|
@ -78,7 +78,9 @@ export default define(meta, paramDef, async (ps, me) => {
|
||||
const nameQuery = Users.createQueryBuilder("user")
|
||||
.where(
|
||||
new Brackets((qb) => {
|
||||
qb.where("user.name ILIKE :query", { query: `%${sqlLikeEscape(ps.query)}%` });
|
||||
qb.where("user.name ILIKE :query", {
|
||||
query: `%${sqlLikeEscape(ps.query)}%`,
|
||||
});
|
||||
|
||||
// Also search username if it qualifies as username
|
||||
if (Users.validateLocalUsername(ps.query)) {
|
||||
|
Loading…
Reference in New Issue
Block a user