parent
6f9ba940b9
commit
93869a5f34
11 changed files with 85 additions and 16 deletions
|
|
@ -40,6 +40,7 @@ export const paramDef = {
|
|||
federating: { type: 'boolean', nullable: true },
|
||||
subscribing: { type: 'boolean', nullable: true },
|
||||
publishing: { type: 'boolean', nullable: true },
|
||||
nsfw: { type: 'boolean', nullable: true },
|
||||
limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 },
|
||||
offset: { type: 'integer', default: 0 },
|
||||
sort: { type: 'string' },
|
||||
|
|
@ -103,6 +104,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
}
|
||||
}
|
||||
|
||||
if (typeof ps.nsfw === 'boolean') {
|
||||
if (ps.nsfw) {
|
||||
query.andWhere('instance.isNSFW = TRUE');
|
||||
} else {
|
||||
query.andWhere('instance.isNSFW = FALSE');
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof ps.silenced === "boolean") {
|
||||
const meta = await this.metaService.fetch(true);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue