<?php

namespace OtomaticAi\RestControllers;

use OtomaticAi\RestControllers\RestController;
use OtomaticAi\Utils\Settings;

class GlobalSystemController extends RestController
{
    public function show()
    {
        return Settings::get('global_systems');
    }

    public function update()
    {
        $this->validate([
            "text_instructions" => ["nullable", "string"],
        ]);

        Settings::update($this->request, 'global_systems');

        Settings::save();

        return [
            "success" => true,
        ];
    }
}
