diff --git a/dashboard/src/components/NotificationSettings.vue b/dashboard/src/components/NotificationSettings.vue new file mode 100644 index 000000000..6ed09fa7b --- /dev/null +++ b/dashboard/src/components/NotificationSettings.vue @@ -0,0 +1,104 @@ + + + diff --git a/dashboard/src/models/ProfileModel.js b/dashboard/src/models/ProfileModel.js index 01c12462f..705c4b4cb 100644 --- a/dashboard/src/models/ProfileModel.js +++ b/dashboard/src/models/ProfileModel.js @@ -208,6 +208,17 @@ function create() { if (error || result.status !== 204) return [error || result]; return [null]; }, + async setNotificationConfig(notificationConfig) { + let error, result; + try { + result = await fetcher.post(`${API_ORIGIN}/api/v1/profile/notification_config`, { notificationConfig }, { access_token: accessToken }); + } catch (e) { + error = e; + } + + if (error || result.status !== 204) return [error || result]; + return [null, result.body]; + }, async setupAccount(data) { let error, result; try { diff --git a/dashboard/src/views/ProfileView.vue b/dashboard/src/views/ProfileView.vue index 22e3d7319..cddc1ab72 100644 --- a/dashboard/src/views/ProfileView.vue +++ b/dashboard/src/views/ProfileView.vue @@ -5,8 +5,9 @@ const i18n = useI18n(); const t = i18n.t; import { ref, onMounted, useTemplateRef } from 'vue'; -import { Button, SingleSelect, Dialog, InputDialog, TextInput, InputGroup } from 'pankow'; +import { Button, SingleSelect, Dialog, InputDialog, TextInput, InputGroup, FormGroup } from 'pankow'; import { TOKEN_TYPES } from '../constants.js'; +import NotificationSettings from '../components/NotificationSettings.vue'; import AppPasswords from '../components/AppPasswords.vue'; import SettingsItem from '../components/SettingsItem.vue'; import Section from '../components/Section.vue'; @@ -326,6 +327,7 @@ onMounted(async () => { +