I cleaned and removed variables.
This commit is contained in:
@@ -86,46 +86,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script async setup>
|
<script async setup>
|
||||||
import {ref, onMounted, onUnmounted} from 'vue';
|
|
||||||
|
|
||||||
const username = ref('');
|
|
||||||
const firstName = ref('');
|
|
||||||
const lastName = ref('');
|
|
||||||
const occupation = ref('');
|
|
||||||
const email = ref('');
|
|
||||||
const phone = ref('');
|
|
||||||
const birthDate = ref('');
|
|
||||||
const country = ref('');
|
|
||||||
const city = ref('');
|
|
||||||
const address = ref('');
|
|
||||||
const titre = ref('');
|
|
||||||
const description = ref('');
|
|
||||||
|
|
||||||
const dateRule = value => {
|
const dateRule = value => {
|
||||||
const datePattern = /^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/(19|20)\d{2}$/;
|
const datePattern = /^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/(19|20)\d{2}$/;
|
||||||
return datePattern.test(value) || 'Format de date invalide (JJ/MM/AAAA)';
|
return datePattern.test(value) || 'Format de date invalide (JJ/MM/AAAA)';
|
||||||
};
|
};
|
||||||
|
|
||||||
const saveAll = () => {
|
|
||||||
const formData = {
|
|
||||||
username: username.value,
|
|
||||||
firstName: firstName.value,
|
|
||||||
lastName: lastName.value,
|
|
||||||
occupation: occupation.value,
|
|
||||||
email: email.value,
|
|
||||||
phone: phone.value,
|
|
||||||
birthDate: birthDate.value,
|
|
||||||
country: country.value,
|
|
||||||
city: city.value,
|
|
||||||
address: address.value,
|
|
||||||
titre: titre.value,
|
|
||||||
description: description.value,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.save-btn {
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -46,16 +46,6 @@ const onFileChange = (event) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const saveAll = () => {
|
|
||||||
const formData = socialNetworks.value.reduce((acc, network) => {
|
|
||||||
acc[network.field] = network.value;
|
|
||||||
return acc;
|
|
||||||
}, {});
|
|
||||||
|
|
||||||
console.log('Form data:', formData);
|
|
||||||
console.log('Icon URL:', iconUrl.value);
|
|
||||||
// Logic to save all fields and the icon
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user