mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-17 23:29:42 -06:00
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:
@@ -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,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user