Use Not(IsNull())
This commit is contained in:
syuilo 2019-05-20 21:44:16 +09:00
parent 5a3ea38bbf
commit e7dd5e155d
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
7 changed files with 27 additions and 13 deletions

View file

@ -2,7 +2,7 @@ import autobind from 'autobind-decorator';
import Chart, { Obj, DeepPartial } from '../../core';
import { SchemaType } from '../../../../misc/schema';
import { Notes } from '../../../../models';
import { Not } from 'typeorm';
import { Not, IsNull } from 'typeorm';
import { Note } from '../../../../models/entities/note';
import { name, schema } from '../schemas/notes';
@ -29,7 +29,7 @@ export default class NotesChart extends Chart<NotesLog> {
protected async fetchActual(): Promise<DeepPartial<NotesLog>> {
const [localCount, remoteCount] = await Promise.all([
Notes.count({ userHost: null }),
Notes.count({ userHost: Not(null) })
Notes.count({ userHost: Not(IsNull()) })
]);
return {