fix(settings): force can_edit=1 for runtime keys in API and DB writes

editable_only now includes RUNTIME_KEYS; normalize can_edit in responses.
UpdateConfig and montzar login persist can_edit=1. SQL override moved before COMMIT.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-19 20:15:28 +03:30
co-authored by Cursor
parent 027170a33f
commit b7eed369c6
4 changed files with 66 additions and 8 deletions
+9
View File
@@ -2159,6 +2159,15 @@ WHERE `key` = 'accounting_provider'
AND TRIM(COALESCE(`value`, '')) IN ('', 'none')
AND EXISTS (SELECT 1 FROM (SELECT `value` FROM `settings` WHERE `key` = 'send_to_tahesab') AS s WHERE s.`value` IN ('true', '1', 'yes'));
-- آخرین override: کلیدهای runtime همیشه can_edit=1 (tenant-only)
UPDATE `settings` SET `can_edit` = 1 WHERE `key` IN (
'montzar_last_product_log', 'montzar_order_response',
'montzar_live_price', 'montzar_mazaneh', 'montzar_diff',
'montzar_truly_buy_mazaneh', 'montzar_truly_sell_mazaneh',
'montzar_token', 'montzar_closed',
'up_price', 'down_price', 'price_extreme_date', 'do_send_liman'
);
COMMIT;
SELECT 'deploy_settings_const.sql finished' AS status;