Initial commit: core-prestashop module v1.1.1
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
const { Log } = require('@orbito/api-lib');
|
||||
const ShopConfig = require('../../src/models/ShopConfig');
|
||||
const { toFormResponse } = require('../../src/config-form');
|
||||
|
||||
module.exports = async function(companyId, instanceId, params, ctx) {
|
||||
const config = await ShopConfig.findOne({ companyId, isRemoved: { $ne: true } });
|
||||
const form = toFormResponse(config);
|
||||
|
||||
Log.debug(companyId, 'config.get', {
|
||||
found: Boolean(config),
|
||||
storeUrl: form.storeUrl,
|
||||
shopPrefix: form.shopPrefix,
|
||||
hasApiKey: form.hasApiKey,
|
||||
psStatesCount: form.psStates?.length ?? 0
|
||||
});
|
||||
|
||||
return { data: form };
|
||||
};
|
||||
Reference in New Issue
Block a user