change: redirect to edit page after create of newsletter and protocol

This commit is contained in:
Julian Krauser 2025-05-29 11:20:54 +02:00
parent caf8e71a51
commit 0defc9b0ba
6 changed files with 16 additions and 9 deletions

View file

@ -63,11 +63,12 @@ export default defineComponent({
};
this.status = "loading";
this.createNewsletter(createNewsletter)
.then(() => {
.then((res) => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
(this.$refs.form as HTMLFormElement).reset();
this.closeModal();
this.$router.push({ name: "admin-club-newsletter-overview", params: { newsletterId: res.data } });
}, 1500);
})
.catch(() => {

View file

@ -4,7 +4,15 @@
:to="{ name: 'admin-club-newsletter-overview', params: { newsletterId: newsletter.id } }"
class="bg-primary p-2 text-white flex flex-row justify-between items-center"
>
<p>{{ newsletter.title }}</p>
<p>
{{ newsletter.title }} ({{
new Date(newsletter.createdAt).toLocaleDateString("de-DE", {
day: "2-digit",
month: "2-digit",
year: "numeric",
})
}})
</p>
<PaperAirplaneIcon v-if="newsletter.isSent" class="w-5 h-5" />
</RouterLink>
<div class="p-2 max-h-48 overflow-y-auto">

View file

@ -66,11 +66,12 @@ export default defineComponent({
};
this.status = "loading";
this.createProtocol(createProtocol)
.then(() => {
.then((res) => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
(this.$refs.form as HTMLFormElement).reset();
this.closeModal();
this.$router.push({ name: "admin-club-protocol-overview", params: { protocolId: res.data } });
}, 1500);
})
.catch(() => {