147 lines
3.9 KiB
Vue
147 lines
3.9 KiB
Vue
<script setup>
|
|
import {ref} from 'vue'
|
|
import {useClient} from "@/plugins/api.js";
|
|
|
|
const props = defineProps({
|
|
creator: {
|
|
required: true
|
|
}
|
|
})
|
|
|
|
const emits = defineEmits(['closeRequested'])
|
|
|
|
const facebookUrl = ref(props.creator.socials.facebookUrl)
|
|
const instagramUrl = ref(props.creator.socials.instagramUrl)
|
|
const linkedInUrl = ref(props.creator.socials.linkedInUrl)
|
|
const redditUrl = ref(props.creator.socials.redditUrl)
|
|
const tikTokUrl = ref(props.creator.socials.tikTokUrl)
|
|
const websiteUrl = ref(props.creator.socials.websiteUrl)
|
|
const xUrl = ref(props.creator.socials.xUrl)
|
|
const youtubeUrl = ref(props.creator.socials.youtubeUrl)
|
|
|
|
const client = useClient()
|
|
const save = async () => {
|
|
try {
|
|
await client.post(
|
|
`/api/creators/${props.creator.id}/socials`,
|
|
{
|
|
"facebookUrl": facebookUrl.value || null,
|
|
"instagramUrl": instagramUrl.value || null,
|
|
"linkedInUrl": linkedInUrl.value || null,
|
|
"redditUrl": redditUrl.value || null,
|
|
"tikTokUrl": tikTokUrl.value || null,
|
|
"websiteUrl": websiteUrl.value || null,
|
|
"xUrl": xUrl.value || null,
|
|
"youtubeUrl": youtubeUrl.value || null,
|
|
})
|
|
|
|
props.creator.socials.facebookUrl = facebookUrl
|
|
props.creator.socials.instagramUrl = instagramUrl
|
|
props.creator.socials.linkedInUrl = linkedInUrl
|
|
props.creator.socials.redditUrl = redditUrl
|
|
props.creator.socials.tikTokUrl = tikTokUrl
|
|
props.creator.socials.websiteUrl = websiteUrl
|
|
props.creator.socials.xUrl = xUrl
|
|
props.creator.socials.youtubeUrl = youtubeUrl
|
|
|
|
emits('closeRequested')
|
|
} catch (error) {
|
|
console.error(error)
|
|
}
|
|
}
|
|
|
|
const cancel = () => {
|
|
emits('closeRequested')
|
|
}
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<div class="pb-5 text-2xl">Reseaux Sociaux</div>
|
|
<div class="flex flex-row align-center">
|
|
<v-icon class="mb-5 mr-2">mdi-facebook</v-icon>
|
|
<v-text-field
|
|
variant="outlined"
|
|
v-model="facebookUrl"
|
|
label="Lien Facebook"
|
|
outlined
|
|
></v-text-field>
|
|
</div>
|
|
|
|
|
|
<div class="flex flex-row align-center">
|
|
<v-icon class="mb-5 mr-2">mdi-instagram</v-icon>
|
|
<v-text-field
|
|
variant="outlined"
|
|
v-model="instagramUrl"
|
|
label="Lien Instagram"
|
|
outlined
|
|
></v-text-field>
|
|
</div>
|
|
|
|
<div class="flex flex-row align-center">
|
|
<v-icon class="mb-5 mr-2">mdi-linkedin</v-icon>
|
|
<v-text-field
|
|
variant="outlined"
|
|
v-model="linkedInUrl"
|
|
label="Lien LinkedIn"
|
|
outlined
|
|
></v-text-field>
|
|
</div>
|
|
|
|
<div class="flex flex-row align-center">
|
|
<v-icon class="mb-5 mr-2">mdi-reddit</v-icon>
|
|
<v-text-field
|
|
variant="outlined"
|
|
v-model="redditUrl"
|
|
label="Lien Reddit"
|
|
outlined
|
|
></v-text-field>
|
|
</div>
|
|
|
|
<div class="flex flex-row align-center">
|
|
<img src="/images/hutopymedia/icons/tiktok.svg" width="23px" height="23px" class="mb-5 mr-2">
|
|
<v-text-field
|
|
variant="outlined"
|
|
v-model="tikTokUrl"
|
|
label="Lien TikTok"
|
|
outlined
|
|
></v-text-field>
|
|
</div>
|
|
|
|
<div class="flex flex-row align-center">
|
|
<v-icon class="mb-5 mr-2">mdi-web</v-icon>
|
|
<v-text-field
|
|
variant="outlined"
|
|
v-model="websiteUrl"
|
|
label="Lien site web"
|
|
outlined
|
|
></v-text-field>
|
|
</div>
|
|
|
|
<div class="flex flex-row align-center">
|
|
<img src="/images/hutopymedia/icons/x.svg" width="23px" height="23px" class="mb-5 mr-2">
|
|
<v-text-field
|
|
variant="outlined"
|
|
v-model="xUrl"
|
|
label="Lien X"
|
|
outlined
|
|
></v-text-field>
|
|
</div>
|
|
|
|
<div class="flex flex-row align-center">
|
|
<v-icon class="mb-5 mr-2">mdi-youtube</v-icon>
|
|
<v-text-field
|
|
variant="outlined"
|
|
v-model="youtubeUrl"
|
|
label="Lien Youtube"
|
|
outlined
|
|
></v-text-field>
|
|
</div>
|
|
|
|
<div class="flex justify-end space-x-4">
|
|
<v-btn color="black" variant="text" @click="cancel">Annuler</v-btn>
|
|
<v-btn color="#A6147D" @click="save">Enregistrer</v-btn>
|
|
</div>
|
|
</template>
|