Migrate to @orbito/api-lib 2.0.0 for single-company container model.
Remove companyId from handlers, models, cron jobs, and cross-module calls to match the v2 one-module-one-company architecture. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+3
-3
@@ -1,17 +1,17 @@
|
||||
const { Log, Core, Utils, Pages } = require('@orbito/api-lib');
|
||||
const ShopConfig = require('../src/models/ShopConfig');
|
||||
|
||||
module.exports = async function(companyId, instanceId, body, params) {
|
||||
module.exports = async function(body, params) {
|
||||
const configId = params.shopId;
|
||||
const isEdit = !!configId;
|
||||
|
||||
let config = null;
|
||||
if (isEdit) {
|
||||
config = await ShopConfig.findOne({ _id: configId, companyId, isRemoved: { $ne: true } });
|
||||
config = await ShopConfig.findOne({ _id: configId, isRemoved: { $ne: true } });
|
||||
if (!config) throw new Error('Config not found');
|
||||
}
|
||||
|
||||
const res = await Core.callModule(companyId, 'core/orders', 'status.search', {});
|
||||
const res = await Core.callModule( 'core/orders', 'status.search', {});
|
||||
const orderStatuses = res.results || [];
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user