Skip to content
Snippets Groups Projects
Commit 4610d8df authored by syuilo's avatar syuilo
Browse files

refactor: fix type

parent fa296efd
No related branches found
No related tags found
No related merge requests found
......@@ -44,16 +44,25 @@ export class WebhookService implements OnApplicationShutdown {
switch (type) {
case 'webhookCreated':
if (body.active) {
this.webhooks.push(body);
this.webhooks.push({
...body,
createdAt: new Date(body.createdAt),
});
}
break;
case 'webhookUpdated':
if (body.active) {
const i = this.webhooks.findIndex(a => a.id === body.id);
if (i > -1) {
this.webhooks[i] = body;
this.webhooks[i] = {
...body,
createdAt: new Date(body.createdAt),
};
} else {
this.webhooks.push(body);
this.webhooks.push({
...body,
createdAt: new Date(body.createdAt),
});
}
} else {
this.webhooks = this.webhooks.filter(a => a.id !== body.id);
......
......@@ -2,7 +2,7 @@ import { Inject, Injectable } from '@nestjs/common';
import { In } from 'typeorm';
import { ModuleRef } from '@nestjs/core';
import { DI } from '@/di-symbols.js';
import type { AccessTokensRepository, NoteReactionsRepository, NotificationsRepository } from '@/models/index.js';
import type { AccessTokensRepository, NoteReactionsRepository, NotificationsRepository, User } from '@/models/index.js';
import { awaitAll } from '@/misc/prelude/await-all.js';
import type { Notification } from '@/models/entities/Notification.js';
import type { NoteReaction } from '@/models/entities/NoteReaction.js';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment