mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-02 11:42:42 +01:00
6199e95577
Summary: Ref T4103. Some settings (mostly nav collapsed/expanded states) use this endpoint to make adjustments when users press keys (like `\` to toggle the durable column). All of these settings are now formal, so swap things over to transactions. Test Plan: Collapsed/expanded various navs, reloaded pages, settings stuck. Reviewers: chad Reviewed By: chad Maniphest Tasks: T4103 Differential Revision: https://secure.phabricator.com/D16035
27 lines
762 B
PHP
27 lines
762 B
PHP
<?php
|
|
|
|
final class PhabricatorSettingsAdjustController
|
|
extends PhabricatorController {
|
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
$viewer = $this->getViewer();
|
|
|
|
$preferences = PhabricatorUserPreferences::loadUserPreferences($viewer);
|
|
|
|
$editor = id(new PhabricatorUserPreferencesEditor())
|
|
->setActor($viewer)
|
|
->setContentSourceFromRequest($request)
|
|
->setContinueOnNoEffect(true)
|
|
->setContinueOnMissingFields(true);
|
|
|
|
$key = $request->getStr('key');
|
|
$value = $request->getStr('value');
|
|
|
|
$xactions = array();
|
|
$xactions[] = $preferences->newTransaction($key, $value);
|
|
|
|
$editor->applyTransactions($preferences, $xactions);
|
|
|
|
return id(new AphrontAjaxResponse())->setContent(array());
|
|
}
|
|
}
|