fix: replace hardcoded response messages with localized strings

- Replace hardcoded 'OK' messages in monitorController with proper localized strings
- Add new string constants to en.json for consistent messaging
- Follow existing pattern used by other controller methods
- Resolves TODO comment in getMonitorsAndSummaryByTeamId method

Fixes: Hardcoded response messages inconsistent with i18n architecture
This commit is contained in:
Preetham001-SR
2025-12-14 23:45:32 +05:30
parent f782899768
commit 124f300362
2 changed files with 9 additions and 5 deletions

View File

@@ -380,7 +380,7 @@ class MonitorController extends BaseController {
const result = await this.monitorService.getMonitorsAndSummaryByTeamId({ teamId, type, explain });
return res.success({
msg: "OK", // TODO
msg: this.stringService.monitorSummaryByTeamId,
data: result,
});
},
@@ -413,7 +413,7 @@ class MonitorController extends BaseController {
});
return res.success({
msg: "OK",
msg: this.stringService.monitorGetByTeamId,
data: monitors,
});
},
@@ -452,7 +452,7 @@ class MonitorController extends BaseController {
const json = await this.monitorService.exportMonitorsToJSON({ teamId });
return res.success({
msg: "OK",
msg: this.stringService.monitorExportSuccess,
data: json,
});
},
@@ -463,7 +463,7 @@ class MonitorController extends BaseController {
getAllGames = this.asyncHandler(
async (req, res) => {
return res.success({
msg: "OK",
msg: this.stringService.gameListSuccess,
data: this.monitorService.getAllGames(),
});
},
@@ -481,7 +481,7 @@ class MonitorController extends BaseController {
const groups = await this.monitorService.getGroupsByTeamId({ teamId });
return res.success({
msg: "OK",
msg: this.stringService.groupsByTeamId,
data: groups,
});
},

View File

@@ -165,6 +165,10 @@
"sendTestEmail": "Test email sent successfully",
"errorForValidEmailAddress": "A valid recipient email address is required.",
"testEmailSubject": "Test E-mail from Checkmate",
"monitorSummaryByTeamId": "Got monitors and summary by team id successfully",
"monitorExportSuccess": "Monitors exported successfully",
"gameListSuccess": "Got game list successfully",
"groupsByTeamId": "Got groups by team id successfully",
"discordNotification": {
"monitor": "Monitor",
"status": "Status",