Compare commits
2 Commits
87f444c30d
...
23bd432c5f
Author | SHA1 | Date | |
---|---|---|---|
23bd432c5f | |||
71b33ab05b |
@ -106,7 +106,7 @@ export class StatsController {
|
||||
@ResponseSchema(ResponseStatsTeam, { isArray: true })
|
||||
@OpenAPI({ description: "Returns the top ten teams by distance.", security: [{ "StatsApiToken": [] }, { "AuthToken": [] }, { "RefreshTokenCookie": [] }] })
|
||||
async getTopTeamsByDistance() {
|
||||
let teams = await getConnection().getRepository(RunnerTeam).find({ relations: ['runners', 'runners.scans', 'runners.distanceDonations', 'runners.scans.track'] });
|
||||
let teams = await getConnection().getRepository(RunnerTeam).find({ relations: ['parentGroup', 'runners', 'runners.scans', 'runners.scans.track'] });
|
||||
if (!teams || teams.length == 0) {
|
||||
return [];
|
||||
}
|
||||
@ -123,7 +123,7 @@ export class StatsController {
|
||||
@ResponseSchema(ResponseStatsTeam, { isArray: true })
|
||||
@OpenAPI({ description: "Returns the top ten teams by donations.", security: [{ "StatsApiToken": [] }, { "AuthToken": [] }, { "RefreshTokenCookie": [] }] })
|
||||
async getTopTeamsByDonations() {
|
||||
let teams = await getConnection().getRepository(RunnerTeam).find({ relations: ['runners', 'runners.scans', 'runners.distanceDonations', 'runners.scans.track'] });
|
||||
let teams = await getConnection().getRepository(RunnerTeam).find({ relations: ['parentGroup', 'runners', 'runners.scans', 'runners.distanceDonations', 'runners.scans.track'] });
|
||||
if (!teams || teams.length == 0) {
|
||||
return [];
|
||||
}
|
||||
|
@ -52,15 +52,11 @@ describe('GET /api/stats/runners/* should return 200', () => {
|
||||
});
|
||||
it('get by donations w/ auth should return 200', async () => {
|
||||
const res = await axios.get(base + '/api/stats/runners/donations', axios_config_stats);
|
||||
console.log("################# Runners by donations #################");
|
||||
console.log(res.data);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.headers['content-type']).toContain("application/json");
|
||||
});
|
||||
it('get by laptime w/ auth should return 200', async () => {
|
||||
const res = await axios.get(base + '/api/stats/runners/laptime', axios_config_stats);
|
||||
console.log("################# Runners by laptime #################");
|
||||
console.log(res.data);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.headers['content-type']).toContain("application/json");
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user