Skip to content

Commit

Permalink
lint: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
GoForceX committed Sep 2, 2023
1 parent e4f34d7 commit 34bbdbd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
5 changes: 2 additions & 3 deletions packages/core/handler/discuss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,9 @@ class DiscussHandler extends Handler {
@perm('discuss', 'view')
@param('limit', DefaultType.Number)
@param('page', DefaultType.Number)
@param('token', DefaultType.String)
async postHotDiscussList(limit: string, page: string, token: string) {
async postHotDiscussList(limit: string, page: string) {
try {
const requester = await tokenModel.stripId(token);
// const requester = await tokenModel.stripId(token);

const data = await discuss.getRecentHotDiscuss(parseInt(limit), parseInt(page));
this.ctx.body = {
Expand Down
11 changes: 5 additions & 6 deletions packages/core/model/discuss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {registerPerm} from '../declare/perm';
import {db} from '../service/db';
import {DuplicateError, NotFoundError, ValidationError} from '../declare/error';
import {comment} from './comment';
import {Document} from 'mongodb';

export class DiscussSchema {
did?: number;
Expand Down Expand Up @@ -211,8 +212,8 @@ export class DiscussModel {
return;
}

async getHotDiscuss(limit: number, page: number): Promise<any> {
const data = await db.aggregate('discuss', [
async getHotDiscuss(limit: number, page: number): Promise<Document[]> {
return await db.aggregate('discuss', [
{$match: {deleted: false}},
{
$lookup: {
Expand All @@ -230,11 +231,10 @@ export class DiscussModel {
{$skip: limit * (page - 1)},
{$limit: limit},
],);
return data;
}

async getRecentHotDiscuss(limit: number, page: number): Promise<any> {
const data = await db.aggregate('discuss', [
async getRecentHotDiscuss(limit: number, page: number): Promise<Document[]> {
return await db.aggregate('discuss', [
{$match: {deleted: false}},
{
$lookup: {
Expand Down Expand Up @@ -263,7 +263,6 @@ export class DiscussModel {
{$skip: limit * (page - 1)},
{$limit: limit},
],);
return data;
}
}

Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/components/card.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Card, Group, Text, useMantineTheme, createStyles, TextProps } from '@mantine/core';
import React from 'react';
import * as utils from '@mantine/utils';
import { PaperProps } from '@mantine/core';

const useStyles = createStyles((theme) => ({
Expand Down

0 comments on commit 34bbdbd

Please sign in to comment.