Adds ChangeBanner for Creators

This commit is contained in:
Jonathan Bourdon
2024-08-05 16:34:09 -04:00
parent 743bfea56e
commit bd30b58463
5 changed files with 140 additions and 167 deletions

View File

@@ -10,11 +10,11 @@
<v-form>
<v-file-input
v-model="selectedFile"
label="Select Image"
label="Choisisez votre contenu"
accept="image/*"
prepend-icon="mdi-camera"
@change="onFileSelected">
</v-file-input>
@change="onFileSelected"
></v-file-input>
<v-img
v-if="url"
@@ -66,14 +66,14 @@ const props = defineProps({
type: String,
required: true
}
});
})
const client = useClient();
const client = useClient()
const selectedFile = ref("");
const url = ref("");
const title = ref("");
const description = ref("");
const selectedFile = ref("")
const url = ref("")
const title = ref("")
const description = ref("")
const onFileSelected = () => {
if (selectedFile.value) {
@@ -99,7 +99,6 @@ const publish = async () => {
} else {
console.error(`Failed to create content ${response.data}`)
}
}

View File

@@ -29,7 +29,7 @@ async function publishPost() {
});
try {
const response = await client.post(
await client.post(
`/api/contents/`,
formData,
{
@@ -37,8 +37,7 @@ async function publishPost() {
'Content-Type': 'multipart/form-data',
}
})
console.log('Files uploaded successfully:', response.data);
closeDialog()
} catch (error) {
console.error(error)