Reverse history order
This commit is contained in:
@@ -46,7 +46,7 @@ export class HistoryService {
|
|||||||
): Promise<SongHistory[]> {
|
): Promise<SongHistory[]> {
|
||||||
return this.prisma.songHistory.findMany({
|
return this.prisma.songHistory.findMany({
|
||||||
where: { user: { id: playerId } },
|
where: { user: { id: playerId } },
|
||||||
orderBy: { playDate: 'asc' },
|
orderBy: { playDate: 'desc' },
|
||||||
skip,
|
skip,
|
||||||
take,
|
take,
|
||||||
});
|
});
|
||||||
@@ -61,7 +61,7 @@ export class HistoryService {
|
|||||||
}): Promise<{ best: number; history: SongHistory[] }> {
|
}): Promise<{ best: number; history: SongHistory[] }> {
|
||||||
const history = await this.prisma.songHistory.findMany({
|
const history = await this.prisma.songHistory.findMany({
|
||||||
where: { user: { id: playerId }, song: { id: songId } },
|
where: { user: { id: playerId }, song: { id: songId } },
|
||||||
orderBy: { playDate: 'asc' },
|
orderBy: { playDate: 'desc' },
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -94,7 +94,7 @@ export class HistoryService {
|
|||||||
): Promise<SearchHistory[]> {
|
): Promise<SearchHistory[]> {
|
||||||
return this.prisma.searchHistory.findMany({
|
return this.prisma.searchHistory.findMany({
|
||||||
where: { user: { id: playerId } },
|
where: { user: { id: playerId } },
|
||||||
orderBy: { searchDate: 'asc' },
|
orderBy: { searchDate: 'desc' },
|
||||||
skip,
|
skip,
|
||||||
take,
|
take,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ Get the history of a single song
|
|||||||
Output
|
Output
|
||||||
&{song2}= POST
|
&{song2}= POST
|
||||||
... /song
|
... /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
|
Output
|
||||||
${userID}= RegisterLogin wowuser
|
${userID}= RegisterLogin wowuser
|
||||||
|
|
||||||
@@ -126,13 +126,13 @@ Get the history of a single song
|
|||||||
Output
|
Output
|
||||||
Integer response status 200
|
Integer response status 200
|
||||||
Array response body history
|
Array response body history
|
||||||
Integer $history[0].userID ${userID}
|
Integer $.history[0].userID ${userID}
|
||||||
Integer $history[0].songID ${song.body.id}
|
Integer $.history[0].songID ${song.body.id}
|
||||||
Integer $history[0].score 65
|
Integer $.history[0].score 65
|
||||||
Integer $history[1].userID ${userID}
|
Integer $.history[1].userID ${userID}
|
||||||
Integer $history[1].songID ${song.body.id}
|
Integer $.history[1].songID ${song.body.id}
|
||||||
Integer $history[1].score 55
|
Integer $.history[1].score 55
|
||||||
Integer $best 65
|
Integer $.best 65
|
||||||
|
|
||||||
[Teardown] Run Keywords DELETE /users/${userID}
|
[Teardown] Run Keywords DELETE /users/${userID}
|
||||||
... AND DELETE /song/${song.body.id}
|
... AND DELETE /song/${song.body.id}
|
||||||
|
|||||||
Reference in New Issue
Block a user