change sort, add lastAnnouncedAt and createdAt by DESC

This commit is contained in:
ogerly 2023-03-29 10:58:12 +02:00
parent a1b8be4329
commit bc4af26667

View File

@ -11,7 +11,11 @@ export class CommunityResolver {
@Query(() => [Community])
async getCommunities(): Promise<Community[]> {
const dbCommunities: DbCommunity[] = await DbCommunity.find({
order: { foreign: 'ASC', publicKey: 'ASC', apiVersion: 'ASC' },
order: {
foreign: 'ASC',
createdAt: 'DESC',
lastAnnouncedAt: 'DESC',
},
})
return dbCommunities.map((dbCom: DbCommunity) => new Community(dbCom))
}