Skip to content

Commit d6ad0c8

Browse files
Refactor TargetUnit queries for consistency
- Renamed `getTargetUnitsQuery` to `TARGET_UNITS_QUERY` for improved clarity and consistency in naming conventions. - Updated the import statement in `TargetUnitRepository` to reflect the new query name. These changes enhance code readability and maintainability within the TargetUnit service.
1 parent 10f816d commit d6ad0c8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

workers/main/src/services/TargetUnit/TargetUnitRepository.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Pool } from 'mysql2/promise';
33
import { TargetUnitRepositoryError } from '../../common/errors';
44
import { GroupName, TargetUnit } from '../../common/types';
55
import { ITargetUnitRepository } from './ITargetUnitRepository';
6-
import { getTargetUnitsQuery } from './queries';
6+
import { TARGET_UNITS_QUERY } from './queries';
77
import { TargetUnitRow } from './types';
88

99
export class TargetUnitRepository implements ITargetUnitRepository {
@@ -36,7 +36,7 @@ export class TargetUnitRepository implements ITargetUnitRepository {
3636
async getTargetUnits(groupName: GroupName): Promise<TargetUnit[]> {
3737
try {
3838
const [rows] = await this.pool.query<TargetUnitRow[]>(
39-
getTargetUnitsQuery,
39+
TARGET_UNITS_QUERY,
4040
[groupName],
4141
);
4242

workers/main/src/services/TargetUnit/queries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const getTargetUnitsQuery = `SELECT
1+
export const TARGET_UNITS_QUERY = `SELECT
22
group_id,
33
group_name,
44
project_id,

0 commit comments

Comments
 (0)