mirror of
https://github.com/zoriya/flood.git
synced 2025-12-06 07:16:18 +00:00
dependencies: bump (major)
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
import Datastore from 'nedb-promises';
|
||||
import path from 'path';
|
||||
|
||||
import type {Notification, NotificationCount, NotificationFetchOptions} from '@shared/types/Notification';
|
||||
import type {
|
||||
Notification,
|
||||
NotificationCount,
|
||||
NotificationFetchOptions,
|
||||
NotificationState,
|
||||
} from '@shared/types/Notification';
|
||||
|
||||
import BaseService from './BaseService';
|
||||
import config from '../../config';
|
||||
@@ -92,16 +97,9 @@ class NotificationService extends BaseService<NotificationServiceEvents> {
|
||||
* Gets notifications
|
||||
*
|
||||
* @param {NotificationFetchOptions} - options - An object of options...
|
||||
* @return {Promise<{Notification[][], NotificationCount}>} - Resolves with notifications and counts or rejects with error.
|
||||
* @return {NotificationState} - Resolves with notifications and counts or rejects with error.
|
||||
*/
|
||||
async getNotifications({
|
||||
allNotifications,
|
||||
start,
|
||||
limit,
|
||||
}: NotificationFetchOptions): Promise<{
|
||||
notifications: Notification[][];
|
||||
count: NotificationCount;
|
||||
}> {
|
||||
async getNotifications({allNotifications, start, limit}: NotificationFetchOptions): Promise<NotificationState> {
|
||||
const sortedNotifications = this.db.find<Notification>({}).sort({ts: -1});
|
||||
|
||||
if (allNotifications) {
|
||||
|
||||
Reference in New Issue
Block a user