This commit is contained in:
HAM!DREZA
2024-06-19 21:03:07 +03:30
parent 3f9e0d7615
commit 607ead8528
20 changed files with 869 additions and 298 deletions
+10 -10
View File
@@ -171,26 +171,26 @@ const edit = async (formData) => {
}
};
async function changePhoto(val) {
console.log("image", val.target.files[0]);
const formData = new FormData();
formData.append('file', val.target.files[0]);
formData.append('directoryName', name.value);
console.log('keys', formData.values());
try {
await $fetch("/api/uploader", {
const dataa = await $fetch("/api/uploader", {
method: "POST",
body: formData,
body: formData
});
console.log('dataa',dataa);
} catch (error) {
console.log('error client', error);
console.log('error client', error.data.data.message);
}
// console.log('ss', formData);
// const data = await useFetch("/api/uploader", {
// method: "POST",
// body: formData
// });
// console.log("done", data.data);
// const data = await useFetch("api/uploader", {
// method: 'POST',
// body: formData
// });
}
</script>