Cleanup profile

This commit is contained in:
2025-02-08 09:49:52 -05:00
parent 22b0f23a07
commit d1d73181f5
9 changed files with 326 additions and 585 deletions

View File

@@ -1,38 +1,60 @@
<template>
<v-card>
<v-card-title>
Courriel
</v-card-title>
<div class="pb-5 text-2xl">Courriel</div>
<div class="m-4">
<v-text-field
variant="outlined"
v-model="email"
label="Votre courriel"
></v-text-field>
</div>
<div class="m-4">
<v-text-field
variant="outlined"
v-model="email"
label="Votre courriel"
></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>
<v-card-actions>
<v-btn variant="plain" @click="requestClose">
Annuler
</v-btn>
<v-btn color="#A6147D" @click="requestSave">
Enregistrer
</v-btn>
</v-card-actions>
</v-card>
</template>
<script setup>
import {ref} from 'vue';
import {useClient} from "@/plugins/api.js";
const props = defineProps(['email'])
const emit = defineEmits(['close', 'save'])
const props = defineProps({
creator: {
required: true
}
})
const email = ref(props.email)
const emits = defineEmits(['closeRequested'])
const email = ref(props.creator.email)
const client = useClient()
const save = async () => {
try {
await client.post(
`/api/creators/${props.creator.id}/email`,
{
"facebookUrl": facebookUrl.value
})
props.creator.socials.facebookUrl = facebookUrl
emits('closeRequested')
} catch (error) {
console.error(error)
}
}
const cancel = () => {
emits('closeRequested')
}
const requestClose = () => emit('close')
const requestSave = () => emit('save', email.value)
</script>