summaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-05-20 21:44:16 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-05-20 21:44:16 +0900
commite7dd5e155d212188de9fbef70e6694b433530559 (patch)
treee8573156fce3590d8e7cf8f12f6028a8d0bfdadd /src/services
parent Fix: Delete is not deliver (#4950) (diff)
downloadsharkey-e7dd5e155d212188de9fbef70e6694b433530559.tar.gz
sharkey-e7dd5e155d212188de9fbef70e6694b433530559.tar.bz2
sharkey-e7dd5e155d212188de9fbef70e6694b433530559.zip
Fix bugs
Use Not(IsNull())
Diffstat (limited to 'src/services')
-rw-r--r--src/services/chart/charts/classes/drive.ts4
-rw-r--r--src/services/chart/charts/classes/notes.ts4
-rw-r--r--src/services/chart/charts/classes/per-user-following.ts6
-rw-r--r--src/services/chart/charts/classes/users.ts4
4 files changed, 9 insertions, 9 deletions
diff --git a/src/services/chart/charts/classes/drive.ts b/src/services/chart/charts/classes/drive.ts
index ae52df19ac..c3bcacb7df 100644
--- a/src/services/chart/charts/classes/drive.ts
+++ b/src/services/chart/charts/classes/drive.ts
@@ -2,7 +2,7 @@ import autobind from 'autobind-decorator';
import Chart, { Obj, DeepPartial } from '../../core';
import { SchemaType } from '../../../../misc/schema';
import { DriveFiles } from '../../../../models';
-import { Not } from 'typeorm';
+import { Not, IsNull } from 'typeorm';
import { DriveFile } from '../../../../models/entities/drive-file';
import { name, schema } from '../schemas/drive';
@@ -31,7 +31,7 @@ export default class DriveChart extends Chart<DriveLog> {
protected async fetchActual(): Promise<DeepPartial<DriveLog>> {
const [localCount, remoteCount, localSize, remoteSize] = await Promise.all([
DriveFiles.count({ userHost: null }),
- DriveFiles.count({ userHost: Not(null) }),
+ DriveFiles.count({ userHost: Not(IsNull()) }),
DriveFiles.clacDriveUsageOfLocal(),
DriveFiles.clacDriveUsageOfRemote()
]);
diff --git a/src/services/chart/charts/classes/notes.ts b/src/services/chart/charts/classes/notes.ts
index 85ccf000d8..815061c445 100644
--- a/src/services/chart/charts/classes/notes.ts
+++ b/src/services/chart/charts/classes/notes.ts
@@ -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 {
diff --git a/src/services/chart/charts/classes/per-user-following.ts b/src/services/chart/charts/classes/per-user-following.ts
index f3809a7c94..8295c0cb0d 100644
--- a/src/services/chart/charts/classes/per-user-following.ts
+++ b/src/services/chart/charts/classes/per-user-following.ts
@@ -2,7 +2,7 @@ import autobind from 'autobind-decorator';
import Chart, { Obj, DeepPartial } from '../../core';
import { SchemaType } from '../../../../misc/schema';
import { Followings, Users } from '../../../../models';
-import { Not } from 'typeorm';
+import { Not, IsNull } from 'typeorm';
import { User } from '../../../../models/entities/user';
import { name, schema } from '../schemas/per-user-following';
@@ -45,8 +45,8 @@ export default class PerUserFollowingChart extends Chart<PerUserFollowingLog> {
] = await Promise.all([
Followings.count({ followerId: group, followeeHost: null }),
Followings.count({ followeeId: group, followerHost: null }),
- Followings.count({ followerId: group, followeeHost: Not(null) }),
- Followings.count({ followeeId: group, followerHost: Not(null) })
+ Followings.count({ followerId: group, followeeHost: Not(IsNull()) }),
+ Followings.count({ followeeId: group, followerHost: Not(IsNull()) })
]);
return {
diff --git a/src/services/chart/charts/classes/users.ts b/src/services/chart/charts/classes/users.ts
index eec30de8dc..47e4caa1b7 100644
--- a/src/services/chart/charts/classes/users.ts
+++ b/src/services/chart/charts/classes/users.ts
@@ -2,7 +2,7 @@ import autobind from 'autobind-decorator';
import Chart, { Obj, DeepPartial } from '../../core';
import { SchemaType } from '../../../../misc/schema';
import { Users } from '../../../../models';
-import { Not } from 'typeorm';
+import { Not, IsNull } from 'typeorm';
import { User } from '../../../../models/entities/user';
import { name, schema } from '../schemas/users';
@@ -29,7 +29,7 @@ export default class UsersChart extends Chart<UsersLog> {
protected async fetchActual(): Promise<DeepPartial<UsersLog>> {
const [localCount, remoteCount] = await Promise.all([
Users.count({ host: null }),
- Users.count({ host: Not(null) })
+ Users.count({ host: Not(IsNull()) })
]);
return {