feat(front): description for playlists
This commit is contained in:
		
							parent
							
								
									c4bcceb358
								
							
						
					
					
						commit
						5323669c57
					
				| 
						 | 
					@ -16,6 +16,7 @@ import Alert from '~/components/ui/Alert.vue'
 | 
				
			||||||
import Button from '~/components/ui/Button.vue'
 | 
					import Button from '~/components/ui/Button.vue'
 | 
				
			||||||
import Input from '~/components/ui/Input.vue'
 | 
					import Input from '~/components/ui/Input.vue'
 | 
				
			||||||
import Slider from '~/components/ui/Slider.vue'
 | 
					import Slider from '~/components/ui/Slider.vue'
 | 
				
			||||||
 | 
					import Textarea from '~/components/ui/Textarea.vue'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface Events {
 | 
					interface Events {
 | 
				
			||||||
  (e: 'update:playlist', value: Playlist): void
 | 
					  (e: 'update:playlist', value: Playlist): void
 | 
				
			||||||
| 
						 | 
					@ -44,6 +45,7 @@ const success = ref(false)
 | 
				
			||||||
const store = useStore()
 | 
					const store = useStore()
 | 
				
			||||||
const name = ref(playlist.value?.name ?? '')
 | 
					const name = ref(playlist.value?.name ?? '')
 | 
				
			||||||
const privacyLevel = ref(playlist.value?.privacy_level ?? store.state.auth.profile?.privacy_level ?? 'me')
 | 
					const privacyLevel = ref(playlist.value?.privacy_level ?? store.state.auth.profile?.privacy_level ?? 'me')
 | 
				
			||||||
 | 
					const description = ref(playlist.value?.description ?? '')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const { t } = useI18n()
 | 
					const { t } = useI18n()
 | 
				
			||||||
const labels = computed(() => ({
 | 
					const labels = computed(() => ({
 | 
				
			||||||
| 
						 | 
					@ -71,7 +73,8 @@ const submit = async () => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const data = {
 | 
					    const data = {
 | 
				
			||||||
      name: name.value,
 | 
					      name: name.value,
 | 
				
			||||||
      privacy_level: privacyLevel.value
 | 
					      privacy_level: privacyLevel.value,
 | 
				
			||||||
 | 
					      description: description.value
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const response = await axios.request({ method, url, data })
 | 
					    const response = await axios.request({ method, url, data })
 | 
				
			||||||
| 
						 | 
					@ -154,9 +157,8 @@ const submit = async () => {
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <!-- TODO: Add description to model and types -->
 | 
					    <!-- TODO: Add description to model and types -->
 | 
				
			||||||
    <div class="field">
 | 
					    <div class="field">
 | 
				
			||||||
      <Textarea
 | 
					      <ContentForm
 | 
				
			||||||
        v-model="playlist?.description"
 | 
					        v-model="description"
 | 
				
			||||||
        :label="t('components.playlists.Form.label.description')"
 | 
					 | 
				
			||||||
        :placeholder="t('components.playlists.Form.placeholder.description')"
 | 
					        :placeholder="t('components.playlists.Form.placeholder.description')"
 | 
				
			||||||
        :rows="3"
 | 
					        :rows="3"
 | 
				
			||||||
        :max-length="500"
 | 
					        :max-length="500"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue