Skip to content

Commit 758cd23

Browse files
committed
Merge branch 'mongoose' of https://github.com/austenstone/github-value into mongoose
2 parents 3aba12d + 5616245 commit 758cd23

File tree

5 files changed

+18
-24
lines changed

5 files changed

+18
-24
lines changed

backend/src/controllers/adoption.controller.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,26 @@ import adoptionService from '../services/adoption.service.js';
44

55
class AdoptionController {
66
async getAdoptions(req: Request, res: Response): Promise<void> {
7-
const { enterprise, daysInactive, org, team, precision, since, until, seats } = req.query as { [key: string]: string | undefined };;
7+
const { enterprise, org, team, since, until, seats } = req.query as { [key: string]: string | undefined };;
88
try {
99
const dateFilter = {
1010
...(since && { $gte: new Date(since) }),
1111
...(until && { $lte: new Date(until) })
1212
};
13-
14-
const query = {
13+
14+
const query = {
1515
filter: {
16-
...enterprise ? {enterprise: 'enterprise'} : undefined,
17-
...org ? { org } : undefined,
18-
...team ? { team } : undefined,
19-
...precision ? { precision } : undefined,
20-
...(Object.keys(dateFilter).length && { date: dateFilter }),
21-
},
22-
projection: {
23-
...seats === '1' ? {} : { seats: 0 },
24-
_id: 0,
25-
__v: 0,
16+
...enterprise ? { enterprise: 'enterprise' } : undefined,
17+
...org ? { org } : undefined,
18+
...team ? { team } : undefined,
19+
...(Object.keys(dateFilter).length && { date: dateFilter }),
20+
},
21+
projection: {
22+
...seats === '1' ? {} : { seats: 0 },
23+
_id: 0,
24+
__v: 0,
25+
}
2626
}
27-
}
2827
const adoptions = await adoptionService.getAllAdoptions2(query);
2928
res.status(200).json(adoptions);
3029
} catch (error) {

backend/src/database.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Database {
4343
} catch (error) {
4444
logger.debug(error);
4545
if (error instanceof Error) {
46-
logger.error(error.message);
46+
logger.error(`Database connection error: ${error.message}`);
4747
}
4848
throw error;
4949
}
@@ -100,8 +100,6 @@ class Database {
100100
total_pr_summaries_created: Number
101101
});
102102

103-
104-
105103
// Editor Schema 🖥️
106104
const EditorSchema = new mongoose.Schema({
107105
name: String,

backend/src/services/adoption.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ type AdoptionType = any;
77

88
export interface GetAdoptionsParams {
99
enterprise?: string;
10-
daysInactive?: number;
1110
org?: string;
12-
team
11+
team?: string;
12+
daysInactive?: number;
1313
precision?: string;
1414
since?: string;
1515
until?: string;
@@ -95,7 +95,7 @@ export class AdoptionService {
9595

9696
try {
9797
return await adoptionModel.find(params.filter, params.projection)
98-
.sort({ date: -1 });
98+
.sort({ date: 1 });
9999
} catch (error) {
100100
logger.error('Error fetching all adoptions:', error);
101101
throw error;

backend/src/services/query.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import mongoose from 'mongoose';
88
import metricsService from './metrics.service.js';
99
import teamsService from './teams.service.js';
1010
import adoptionService from './adoption.service.js';
11-
import { time } from 'console';
1211

1312
const DEFAULT_CRON_EXPRESSION = '0 * * * *';
1413
class QueryService {
@@ -44,7 +43,7 @@ class QueryService {
4443
this.cronJob.stop();
4544
}
4645

47-
private async task() { //enterprise level
46+
private async task() {
4847
const queryAt = new Date();
4948
const tasks = [];
5049
for await (const { octokit, installation } of this.app.eachInstallation.iterator()) {

frontend/src/app/highcharts.theme.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,12 @@ const theme: Highcharts.Options = {
8080
states: {
8181
hover: {
8282
fill: 'var(--mdc-filled-button-container-color)',
83-
brightness: 1.08,
8483
style: {
8584
color: 'var(--mdc-filled-button-label-text-color)'
8685
}
8786
},
8887
select: {
8988
fill: 'var(--mdc-filled-button-container-color)',
90-
brightness: 0.95
9189
}
9290
},
9391
paddingLeft: 24,

0 commit comments

Comments
 (0)