change: redirect to edit page after create of newsletter and protocol
This commit is contained in:
parent
caf8e71a51
commit
0defc9b0ba
6 changed files with 16 additions and 9 deletions
|
@ -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(() => {
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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(() => {
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import { defineStore } from "pinia";
|
||||
import type { CreateNewsletterViewModel, SyncNewsletterViewModel } from "@/viewmodels/admin/club/newsletter/newsletter.models";
|
||||
import type { CreateNewsletterViewModel } from "@/viewmodels/admin/club/newsletter/newsletter.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import type { NewsletterViewModel } from "@/viewmodels/admin/club/newsletter/newsletter.models";
|
||||
import cloneDeep from "lodash.clonedeep";
|
||||
import isEqual from "lodash.isequal";
|
||||
import difference from "lodash.difference";
|
||||
|
||||
export const useNewsletterStore = defineStore("newsletter", {
|
||||
state: () => {
|
||||
|
@ -72,7 +71,6 @@ export const useNewsletterStore = defineStore("newsletter", {
|
|||
const result = await http.post(`/admin/newsletter`, {
|
||||
title: newsletter.title,
|
||||
});
|
||||
this.fetchNewsletters();
|
||||
return result;
|
||||
},
|
||||
async synchronizeActiveNewsletter(): Promise<void> {
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import { defineStore } from "pinia";
|
||||
import type { CreateProtocolViewModel, SyncProtocolViewModel } from "@/viewmodels/admin/club/protocol/protocol.models";
|
||||
import type { CreateProtocolViewModel } from "@/viewmodels/admin/club/protocol/protocol.models";
|
||||
import { http } from "@/serverCom";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import type { ProtocolViewModel } from "@/viewmodels/admin/club/protocol/protocol.models";
|
||||
import cloneDeep from "lodash.clonedeep";
|
||||
import isEqual from "lodash.isequal";
|
||||
import difference from "lodash.difference";
|
||||
|
||||
export const useProtocolStore = defineStore("protocol", {
|
||||
state: () => {
|
||||
|
@ -73,7 +72,6 @@ export const useProtocolStore = defineStore("protocol", {
|
|||
title: protocol.title,
|
||||
date: protocol.date,
|
||||
});
|
||||
this.fetchProtocols();
|
||||
return result;
|
||||
},
|
||||
async synchronizeActiveProtocol(): Promise<void> {
|
||||
|
|
|
@ -7,6 +7,7 @@ export interface NewsletterViewModel {
|
|||
newsletterSignatur: string;
|
||||
isSent: boolean;
|
||||
recipientsByQueryId?: string | null;
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
export interface CreateNewsletterViewModel {
|
||||
|
|
Loading…
Add table
Reference in a new issue