Reverse history order
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
@@ -102,7 +102,7 @@ Get the history of a single song
|
||||
Output
|
||||
&{song2}= POST
|
||||
... /song
|
||||
... {"name": "Mama mia", "difficulties": {}, "midiPath": "/musics/Beethoven-125-4.midi", "musicXmlPath": "/musics/Beethoven-125-4.mxl"}
|
||||
... {"name": "Mama mia2", "difficulties": {}, "midiPath": "/musics/Beethoven-125-42.midi", "musicXmlPath": "/musics/Beethoven-125-24.mxl"}
|
||||
Output
|
||||
${userID}= RegisterLogin wowuser
|
||||
|
||||
@@ -126,13 +126,13 @@ Get the history of a single song
|
||||
Output
|
||||
Integer response status 200
|
||||
Array response body history
|
||||
Integer $history[0].userID ${userID}
|
||||
Integer $history[0].songID ${song.body.id}
|
||||
Integer $history[0].score 65
|
||||
Integer $history[1].userID ${userID}
|
||||
Integer $history[1].songID ${song.body.id}
|
||||
Integer $history[1].score 55
|
||||
Integer $best 65
|
||||
Integer $.history[0].userID ${userID}
|
||||
Integer $.history[0].songID ${song.body.id}
|
||||
Integer $.history[0].score 65
|
||||
Integer $.history[1].userID ${userID}
|
||||
Integer $.history[1].songID ${song.body.id}
|
||||
Integer $.history[1].score 55
|
||||
Integer $.best 65
|
||||
|
||||
[Teardown] Run Keywords DELETE /users/${userID}
|
||||
... AND DELETE /song/${song.body.id}
|
||||
|
||||
Reference in New Issue
Block a user