Fix type
This commit is contained in:
parent
1441fd93b9
commit
aa2c8d101e
|
@ -1,7 +1,7 @@
|
||||||
import { User } from '../../../models/entities/user';
|
import { User } from '../../../models/entities/user';
|
||||||
import { Brackets, SelectQueryBuilder } from 'typeorm';
|
import { Brackets, SelectQueryBuilder } from 'typeorm';
|
||||||
|
|
||||||
export function generateRepliesQuery(q: SelectQueryBuilder<any>, me?: User) {
|
export function generateRepliesQuery(q: SelectQueryBuilder<any>, me?: User | null) {
|
||||||
if (me == null) {
|
if (me == null) {
|
||||||
q.andWhere(new Brackets(qb => { qb
|
q.andWhere(new Brackets(qb => { qb
|
||||||
.where(`note.replyId IS NULL`) // 返信ではない
|
.where(`note.replyId IS NULL`) // 返信ではない
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { User } from '../../../models/entities/user';
|
||||||
import { Followings } from '../../../models';
|
import { Followings } from '../../../models';
|
||||||
import { Brackets, SelectQueryBuilder } from 'typeorm';
|
import { Brackets, SelectQueryBuilder } from 'typeorm';
|
||||||
|
|
||||||
export function generateVisibilityQuery(q: SelectQueryBuilder<any>, me?: User) {
|
export function generateVisibilityQuery(q: SelectQueryBuilder<any>, me?: User | null) {
|
||||||
if (me == null) {
|
if (me == null) {
|
||||||
q.andWhere(new Brackets(qb => { qb
|
q.andWhere(new Brackets(qb => { qb
|
||||||
.where(`note.visibility = 'public'`)
|
.where(`note.visibility = 'public'`)
|
||||||
|
|
Loading…
Reference in New Issue