Adds edition of slug.

This commit is contained in:
2025-04-16 15:26:29 -04:00
parent 41aeb81a00
commit 887f6f255a
6 changed files with 328 additions and 66 deletions

View File

@@ -0,0 +1,69 @@
<script setup>
import {ref} from 'vue';
import {useClient} from '@/plugins/api.js';
const props = defineProps({
creator: {
required: true
}
});
const emits = defineEmits(['closeRequested']);
const name = ref(props.creator.name);
const client = useClient();
async function save() {
try {
await client.post(
`/api/creators/${props.creator.id}/name`,
{
name: name.value
}
);
props.creator.name = name.value;
emits('closeRequested');
} catch (error) {
console.error('Error saving title:', error);
}
}
const cancel = () => {
emits('closeRequested');
};
</script>
<template>
<div class="card dialog">
<div class="card-title">
Modifier le Nom
</div>
<div class="card-content">
<v-text-field
v-model="name"
label="Name"
outlined
variant="outlined"
></v-text-field>
<div class="card-actions">
<button class="secondary"
@click="cancel">
Annuler
</button>
<button class="primary"
@click="save">
Enregistrer
</button>
</div>
</div>
</div>
</template>
<style scoped>
</style>