parent
b1493650f4
commit
4555596212
@ -3,9 +3,14 @@ import Database from '../../../db'
|
||||
import { Label } from '../../../lexicon/types/com/atproto/label/defs'
|
||||
import { ids } from '../../../lexicon/lexicons'
|
||||
import { sql } from 'kysely'
|
||||
import { NotEmptyArray } from '@atproto/common'
|
||||
|
||||
export type Labels = Record<string, Label[]>
|
||||
|
||||
// @TODO forward these labels to client
|
||||
// these are labels are currently only used server side & not sent to client since it does not handle them correctly
|
||||
const SERVER_SIDE_LABELS: NotEmptyArray<string> = ['!no-promote']
|
||||
|
||||
export class LabelService {
|
||||
constructor(public db: Database) {}
|
||||
|
||||
@ -68,6 +73,7 @@ export class LabelService {
|
||||
const res = await this.db.db
|
||||
.selectFrom('label')
|
||||
.where('label.uri', 'in', subjects)
|
||||
.where('label.val', 'not in', SERVER_SIDE_LABELS)
|
||||
.if(!includeNeg, (qb) => qb.where('neg', '=', 0))
|
||||
.selectAll()
|
||||
.execute()
|
||||
|
Loading…
x
Reference in New Issue
Block a user