Remove unused NameTileEditor
This commit is contained in:
@@ -1,76 +0,0 @@
|
|||||||
<script setup>
|
|
||||||
import {computed, ref} from "vue";
|
|
||||||
import {useClient} from "@/plugins/api.js";
|
|
||||||
import NameTitle from "@/views/creators/NameTitle.vue";
|
|
||||||
import NameEditor from "@/views/creators/NameEditor.vue";
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
creator: {
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const emits = defineEmits(['closeRequested'])
|
|
||||||
|
|
||||||
const name = ref(props.creator.name);
|
|
||||||
const title = ref(props.creator.title);
|
|
||||||
|
|
||||||
const canSave = computed(() => name != props.creator.name);
|
|
||||||
|
|
||||||
const client = useClient()
|
|
||||||
const save = async () => {
|
|
||||||
try {
|
|
||||||
await client.post(`/api/creators/${props.creator.id}/name`);
|
|
||||||
await client.post(`/api/creators/${props.creator.id}/title`);
|
|
||||||
props.creator.creator.name = name;
|
|
||||||
props.creator.title.name = title;
|
|
||||||
emits('closeRequested')
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function cancel() {
|
|
||||||
emits('closeRequested');
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="pb-5 text-2xl">
|
|
||||||
Modifier le Titre
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-col space-y-4">
|
|
||||||
<name-editor
|
|
||||||
:name="name"
|
|
||||||
></name-editor>
|
|
||||||
|
|
||||||
<v-text-field
|
|
||||||
variant="outlined"
|
|
||||||
v-model="title"
|
|
||||||
label="Titre"
|
|
||||||
outlined
|
|
||||||
></v-text-field>
|
|
||||||
|
|
||||||
<div class="flex justify-end space-x-4">
|
|
||||||
|
|
||||||
<v-btn color="black"
|
|
||||||
variant="text"
|
|
||||||
@click="cancel">
|
|
||||||
Annuler
|
|
||||||
</v-btn>
|
|
||||||
|
|
||||||
<v-btn color="#A6147D"
|
|
||||||
:disabled="!canSave"
|
|
||||||
@click="save">
|
|
||||||
Enregistrer
|
|
||||||
</v-btn>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
Reference in New Issue
Block a user