Reverse history order

This commit is contained in:
2023-05-23 17:20:28 +09:00
parent d4f8afd61b
commit 155e6f49af
2 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -46,7 +46,7 @@ export class HistoryService {
): Promise<SongHistory[]> {
return this.prisma.songHistory.findMany({
where: { user: { id: playerId } },
orderBy: { playDate: 'asc' },
orderBy: { playDate: 'desc' },
skip,
take,
});
@@ -61,7 +61,7 @@ export class HistoryService {
}): Promise<{ best: number; history: SongHistory[] }> {
const history = await this.prisma.songHistory.findMany({
where: { user: { id: playerId }, song: { id: songId } },
orderBy: { playDate: 'asc' },
orderBy: { playDate: 'desc' },
});
return {
@@ -94,7 +94,7 @@ export class HistoryService {
): Promise<SearchHistory[]> {
return this.prisma.searchHistory.findMany({
where: { user: { id: playerId } },
orderBy: { searchDate: 'asc' },
orderBy: { searchDate: 'desc' },
skip,
take,
});