Skip to content

Commit 1668f95

Browse files
committed
[engine-cyberia] Clean up quotes and update comment in action service
Standardize string quotes from double to single. Clarify that quest OFFERS are not resolved in the action fallback.
1 parent d357c0c commit 1668f95

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/api/cyberia-action/cyberia-action.service.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ const logger = loggerFactory(import.meta);
88
class CyberiaActionService {
99
static post = async (req, res, options) => {
1010
/** @type {import('./cyberia-action.model.js').CyberiaActionModel} */
11-
const CyberiaAction = DataBaseProviderService.getModel("CyberiaAction", options);
11+
const CyberiaAction = DataBaseProviderService.getModel('CyberiaAction', options);
1212
return await new CyberiaAction(req.body).save();
1313
};
1414
static get = async (req, res, options) => {
1515
/** @type {import('./cyberia-action.model.js').CyberiaActionModel} */
16-
const CyberiaAction = DataBaseProviderService.getModel("CyberiaAction", options);
16+
const CyberiaAction = DataBaseProviderService.getModel('CyberiaAction', options);
1717
if (req.params.id) return await CyberiaAction.findById(req.params.id);
1818

1919
// Parse query parameters using DataQuery helper
@@ -29,26 +29,27 @@ class CyberiaActionService {
2929
};
3030
static getByCode = async (req, res, options) => {
3131
/** @type {import('./cyberia-action.model.js').CyberiaActionModel} */
32-
const CyberiaAction = DataBaseProviderService.getModel("CyberiaAction", options);
32+
const CyberiaAction = DataBaseProviderService.getModel('CyberiaAction', options);
3333
const { code } = req.params;
3434
if (!code) throw new Error('code parameter is required');
3535
const data = await CyberiaAction.findOne({ code }).lean();
3636
if (data) return data;
3737
// Fallback world delivers actions to the Go server from the canonical
3838
// defaults without persisting them; serve those so the client can fetch the
39-
// action's label + dialogue map by code.
39+
// action's label + dialogue map by code. Quest OFFERS are NOT resolved here —
40+
// the client locates offered quests via the cyberia-quest API by cell.
4041
const fallback = DefaultCyberiaActions.find((a) => a.code === code);
4142
if (fallback) return fallback;
4243
throw new Error(`No action found for code: ${code}`);
4344
};
4445
static put = async (req, res, options) => {
4546
/** @type {import('./cyberia-action.model.js').CyberiaActionModel} */
46-
const CyberiaAction = DataBaseProviderService.getModel("CyberiaAction", options);
47+
const CyberiaAction = DataBaseProviderService.getModel('CyberiaAction', options);
4748
return await CyberiaAction.findByIdAndUpdate(req.params.id, req.body);
4849
};
4950
static delete = async (req, res, options) => {
5051
/** @type {import('./cyberia-action.model.js').CyberiaActionModel} */
51-
const CyberiaAction = DataBaseProviderService.getModel("CyberiaAction", options);
52+
const CyberiaAction = DataBaseProviderService.getModel('CyberiaAction', options);
5253
if (req.params.id) return await CyberiaAction.findByIdAndDelete(req.params.id);
5354
else return await CyberiaAction.deleteMany();
5455
};

0 commit comments

Comments
 (0)