Refactor (#7394)
* wip * wip * wip * wip * wip * Update define.ts * Update update.ts * Update user.ts * wip * wip * Update request.ts * URL * wip * wip * wip * wip * Update invite.ts * Update create.ts
This commit is contained in:
@@ -35,7 +35,7 @@ export default class ActiveUsersChart extends Chart<ActiveUsersLog> {
|
||||
}
|
||||
|
||||
@autobind
|
||||
public async update(user: User) {
|
||||
public async update(user: { id: User['id'], host: User['host'] }) {
|
||||
const update: Obj = {
|
||||
users: [user.id]
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ export default class HashtagChart extends Chart<HashtagLog> {
|
||||
}
|
||||
|
||||
@autobind
|
||||
public async update(hashtag: string, user: User) {
|
||||
public async update(hashtag: string, user: { id: User['id'], host: User['host'] }) {
|
||||
const update: Obj = {
|
||||
users: [user.id]
|
||||
};
|
||||
|
||||
@@ -100,7 +100,7 @@ export default class PerUserFollowingChart extends Chart<PerUserFollowingLog> {
|
||||
}
|
||||
|
||||
@autobind
|
||||
public async update(follower: User, followee: User, isFollow: boolean) {
|
||||
public async update(follower: { id: User['id']; host: User['host']; }, followee: { id: User['id']; host: User['host']; }, isFollow: boolean) {
|
||||
const update: Obj = {};
|
||||
|
||||
update.total = isFollow ? 1 : -1;
|
||||
|
||||
@@ -46,7 +46,7 @@ export default class PerUserNotesChart extends Chart<PerUserNotesLog> {
|
||||
}
|
||||
|
||||
@autobind
|
||||
public async update(user: User, note: Note, isAdditional: boolean) {
|
||||
public async update(user: { id: User['id'] }, note: Note, isAdditional: boolean) {
|
||||
const update: Obj = {
|
||||
diffs: {}
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ export default class PerUserReactionsChart extends Chart<PerUserReactionsLog> {
|
||||
}
|
||||
|
||||
@autobind
|
||||
public async update(user: User, note: Note) {
|
||||
public async update(user: { id: User['id'], host: User['host'] }, note: Note) {
|
||||
this.inc({
|
||||
[Users.isLocalUser(user) ? 'local' : 'remote']: { count: 1 }
|
||||
}, note.userId);
|
||||
|
||||
@@ -59,7 +59,7 @@ export default class UsersChart extends Chart<UsersLog> {
|
||||
}
|
||||
|
||||
@autobind
|
||||
public async update(user: User, isAdditional: boolean) {
|
||||
public async update(user: { id: User['id'], host: User['host'] }, isAdditional: boolean) {
|
||||
const update: Obj = {};
|
||||
|
||||
update.total = isAdditional ? 1 : -1;
|
||||
|
||||
Reference in New Issue
Block a user