Commit 4b8afe00 authored by nanahira's avatar nanahira

Merge branch 'master' of git.mycard.moe:nanahira/wenyuanwall-api

parents a08408f6 44259417
Pipeline #42159 passed with stages
in 3 minutes and 40 seconds
...@@ -32,7 +32,6 @@ export class WhitelistAccount extends IdBase() { ...@@ -32,7 +32,6 @@ export class WhitelistAccount extends IdBase() {
@NotQueryable() @NotQueryable()
@StringColumn(255, { @StringColumn(255, {
description: 'Twitter ID', description: 'Twitter ID',
required: true,
}) })
twitter: string; twitter: string;
...@@ -64,8 +63,8 @@ export class WhitelistAccount extends IdBase() { ...@@ -64,8 +63,8 @@ export class WhitelistAccount extends IdBase() {
@QueryColumn() @QueryColumn()
@QueryCondition((obj, qb, entityName, key) => { @QueryCondition((obj, qb, entityName, key) => {
if (obj[key] === 1) { if (obj[key] === 1) {
qb.orderBy('RANDOM()') qb.andWhere(`${entityName}.enabled = TRUE`)
.andWhere(`${entityName}.enabled = TRUE`); .orderBy('RANDOM()');
} }
}) })
random: number; random: number;
......
...@@ -6,11 +6,7 @@ import { ...@@ -6,11 +6,7 @@ import {
import { InjectRepository } from '@nestjs/typeorm'; import { InjectRepository } from '@nestjs/typeorm';
@Injectable() @Injectable()
export class WhitelistAccountService extends WhitelistAccountFactory.crudService( export class WhitelistAccountService extends WhitelistAccountFactory.crudService() {
{
// extraGetQuery: (qb) => qb.andWhere('whitelistAccount.enabled = TRUE'),
},
) {
constructor(@InjectRepository(WhitelistAccount) repo) { constructor(@InjectRepository(WhitelistAccount) repo) {
super(repo); super(repo);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment