my-settings.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!--
  2. Page 'Mes préférences'
  3. -->
  4. <template>
  5. <LayoutContainer>
  6. <v-col cols="12" sm="12" md="12">
  7. <v-expansion-panels v-model="openedPanels" :multiple="true">
  8. <UiExpansionPanel title="message_settings" icon="fas fa-inbox">
  9. <v-container fluid class="container">
  10. <v-row>
  11. <UiLoadingPanel v-if="pending" />
  12. <UiForm v-else v-model="preferences" action-position="bottom">
  13. <v-row>
  14. <v-col cols="12">
  15. <UiInputCheckbox
  16. v-model="preferences.messageReport"
  17. field="messageReport"
  18. label="allow_report_message"
  19. />
  20. </v-col>
  21. </v-row>
  22. </UiForm>
  23. </v-row>
  24. </v-container>
  25. </UiExpansionPanel>
  26. </v-expansion-panels>
  27. </v-col>
  28. </LayoutContainer>
  29. </template>
  30. <script setup lang="ts">
  31. import type { Ref } from 'vue'
  32. import { useEntityFetch } from '~/composables/data/useEntityFetch'
  33. import Preferences from '~/models/Access/Preferences'
  34. import { useAccessProfileStore } from '~/stores/accessProfile'
  35. definePageMeta({
  36. name: 'my_settings_page',
  37. })
  38. const accessProfileStore = useAccessProfileStore()
  39. if (accessProfileStore.preferencesId === null) {
  40. throw new Error("Missing access preference's id")
  41. }
  42. const { fetch } = useEntityFetch()
  43. const openedPanels: Ref<Array<number>> = ref([0])
  44. const { data: preferences, pending } = await fetch(
  45. Preferences,
  46. accessProfileStore.preferencesId,
  47. )
  48. </script>
  49. <style scoped lang="scss"></style>