Add api to upload attachments

This commit is contained in:
Matias De lellis
2020-11-12 19:31:45 -03:00
parent 2dfd847e1e
commit e6653c171f
4 changed files with 146 additions and 6 deletions

View File

@@ -36,6 +36,9 @@ class SettingsService {
const COLOR_FOR_NEW_NOTES_KEY = 'default_color';
const DEFAULT_COLOR_FOR_NEW_NOTES = '#F7EB96';
const ATTACHMENTS_FOLDER_KEY = 'attachments_folder';
const DEFAULT_ATTACHMENTS_FOLDER = 'Quicknotes';
/** @var IConfig Config */
private $config;
@@ -62,4 +65,12 @@ class SettingsService {
$this->config->setUserValue($this->userId, Application::APP_ID, self::COLOR_FOR_NEW_NOTES_KEY, $color);
}
public function getAttachmentsFolder(): string {
return $this->config->getUserValue($this->userId, Application::APP_ID, self::ATTACHMENTS_FOLDER_KEY, self::DEFAULT_ATTACHMENTS_FOLDER);
}
public function setAttachmentsFolder(string $folder) {
$this->config->setUserValue($this->userId, Application::APP_ID, self::ATTACHMENTS_FOLDER_KEY, $folder);
}
}