Commit 57c29d90 authored by Emiliano Balbuena's avatar Emiliano Balbuena

(fix): Pro settings and style

1 merge request!281WIP: (feat): Minds Pro
Pipeline #73229516 failed with stages
in 14 minutes and 20 seconds
......@@ -139,11 +139,11 @@ class Manager
}
/**
* @param array $settings
* @param array $values
* @return bool
* @throws Exception
*/
public function set(array $settings = [])
public function set(array $values = [])
{
if (!$this->user) {
throw new Exception('Invalid user');
......@@ -154,46 +154,46 @@ class Manager
$settings
->setUserGuid($this->user->guid);
if (isset($settings['domain'])) {
if (isset($values['domain'])) {
// TODO: Validate!
$settings
->setDomain($settings['domain']);
->setDomain($values['domain']);
}
if (isset($settings['title'])) {
if (isset($values['title'])) {
// TODO: Validate!
$settings
->setTitle($settings['title']);
->setTitle($values['title']);
}
if (isset($settings['headline'])) {
if (isset($values['headline'])) {
// TODO: Validate!
$settings
->setHeadline($settings['headline']);
->setHeadline($values['headline']);
}
if (isset($settings['text_color'])) {
if (isset($values['text_color'])) {
// TODO: Validate!
$settings
->setTextColor($settings['text_color']);
->setTextColor($values['text_color']);
}
if (isset($settings['primary_color'])) {
if (isset($values['primary_color'])) {
// TODO: Validate!
$settings
->setPrimaryColor($settings['primary_color']);
->setPrimaryColor($values['primary_color']);
}
if (isset($settings['plain_background_color'])) {
if (isset($values['plain_background_color'])) {
// TODO: Validate!
$settings
->setPlainBackgroundColor($settings['plain_background_color']);
->setPlainBackgroundColor($values['plain_background_color']);
}
return $this->repository->update($settings);
......
......@@ -77,6 +77,11 @@ class Settings implements JsonSerializable
'plain_background_color' => $this->plainBackgroundColor,
'background_image' => $this->backgroundImage,
'logo_image' => $this->logoImage,
'styles' => [
'text_color' => $this->textColor ?: '#000000',
'primary_color' => $this->primaryColor ?: '#4690df',
'plain_background_color' => $this->plainBackgroundColor ?: '#ffffff',
],
];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment