Files
core-prestashop/methods/deleteConfig.js
T
fatequodandCursor 1a6a978a21 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>
2026-07-08 11:21:35 +02:00

15 lines
479 B
JavaScript

const { DB, Utils, Log } = require('@orbito/api-lib');
const ShopConfigSchema = require('../src/models/ShopConfig');
module.exports = async function(params, ctx) {
const { _id } = params;
if (!_id) throw new Error('Missing _id');
const config = await ShopConfigSchema.findOne({ _id, isRemoved: { $ne: true } });
if (!config) throw new Error('Config not found');
await ShopConfigSchema.update({ _id }, { isRemoved: true });
return { success: true };
}