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