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() {
@NotQueryable()
@StringColumn(255, {
description: 'Twitter ID',
required: true,
})
twitter: string;
......@@ -64,8 +63,8 @@ export class WhitelistAccount extends IdBase() {
@QueryColumn()
@QueryCondition((obj, qb, entityName, key) => {
if (obj[key] === 1) {
qb.orderBy('RANDOM()')
.andWhere(`${entityName}.enabled = TRUE`);
qb.andWhere(`${entityName}.enabled = TRUE`)
.orderBy('RANDOM()');
}
})
random: number;
......
......@@ -6,11 +6,7 @@ import {
import { InjectRepository } from '@nestjs/typeorm';
@Injectable()
export class WhitelistAccountService extends WhitelistAccountFactory.crudService(
{
// extraGetQuery: (qb) => qb.andWhere('whitelistAccount.enabled = TRUE'),
},
) {
export class WhitelistAccountService extends WhitelistAccountFactory.crudService() {
constructor(@InjectRepository(WhitelistAccount) 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