fix: universal curl sort on getAll
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
"license": "MIT",
|
||||
"dashboard": {
|
||||
"repo": "mx-space/admin-next",
|
||||
"version": "3.11.5"
|
||||
"version": "3.11.6"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import { DocumentType } from '@typegoose/typegoose'
|
||||
import { isDefined, isMongoId } from 'class-validator'
|
||||
import { pick } from 'lodash'
|
||||
import { FilterQuery } from 'mongoose'
|
||||
import { InjectModel } from 'nestjs-typegoose'
|
||||
import { CannotFindException } from '~/common/exceptions/cant-find.exception'
|
||||
@@ -128,12 +127,7 @@ export class NoteService {
|
||||
})
|
||||
|
||||
process.nextTick(async () => {
|
||||
await Promise.all([
|
||||
this.webGateway.broadcast(
|
||||
EventTypes.NOTE_DELETE,
|
||||
pick(doc, ['_id', 'id', 'nid', 'created', 'modified']),
|
||||
),
|
||||
])
|
||||
await Promise.all([this.webGateway.broadcast(EventTypes.NOTE_DELETE, id)])
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ export function BaseCrudFactory<
|
||||
|
||||
@Get('/all')
|
||||
async getAll() {
|
||||
return await this._model.find({}).lean()
|
||||
return await this._model.find({}).sort({ created: -1 }).lean()
|
||||
}
|
||||
|
||||
@Post('/')
|
||||
|
||||
Reference in New Issue
Block a user