minor v1.6.0 #106
6 changed files with 16 additions and 9 deletions
|
@ -63,11 +63,12 @@ export default defineComponent({
|
||||||
};
|
};
|
||||||
this.status = "loading";
|
this.status = "loading";
|
||||||
this.createNewsletter(createNewsletter)
|
this.createNewsletter(createNewsletter)
|
||||||
.then(() => {
|
.then((res) => {
|
||||||
this.status = { status: "success" };
|
this.status = { status: "success" };
|
||||||
this.timeout = setTimeout(() => {
|
this.timeout = setTimeout(() => {
|
||||||
(this.$refs.form as HTMLFormElement).reset();
|
(this.$refs.form as HTMLFormElement).reset();
|
||||||
this.closeModal();
|
this.closeModal();
|
||||||
|
this.$router.push({ name: "admin-club-newsletter-overview", params: { newsletterId: res.data } });
|
||||||
}, 1500);
|
}, 1500);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|
|
@ -4,7 +4,15 @@
|
||||||
:to="{ name: 'admin-club-newsletter-overview', params: { newsletterId: newsletter.id } }"
|
:to="{ name: 'admin-club-newsletter-overview', params: { newsletterId: newsletter.id } }"
|
||||||
class="bg-primary p-2 text-white flex flex-row justify-between items-center"
|
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" />
|
<PaperAirplaneIcon v-if="newsletter.isSent" class="w-5 h-5" />
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
<div class="p-2 max-h-48 overflow-y-auto">
|
<div class="p-2 max-h-48 overflow-y-auto">
|
||||||
|
|
|
@ -66,11 +66,12 @@ export default defineComponent({
|
||||||
};
|
};
|
||||||
this.status = "loading";
|
this.status = "loading";
|
||||||
this.createProtocol(createProtocol)
|
this.createProtocol(createProtocol)
|
||||||
.then(() => {
|
.then((res) => {
|
||||||
this.status = { status: "success" };
|
this.status = { status: "success" };
|
||||||
this.timeout = setTimeout(() => {
|
this.timeout = setTimeout(() => {
|
||||||
(this.$refs.form as HTMLFormElement).reset();
|
(this.$refs.form as HTMLFormElement).reset();
|
||||||
this.closeModal();
|
this.closeModal();
|
||||||
|
this.$router.push({ name: "admin-club-protocol-overview", params: { protocolId: res.data } });
|
||||||
}, 1500);
|
}, 1500);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import { defineStore } from "pinia";
|
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 { http } from "@/serverCom";
|
||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
import type { NewsletterViewModel } from "@/viewmodels/admin/club/newsletter/newsletter.models";
|
import type { NewsletterViewModel } from "@/viewmodels/admin/club/newsletter/newsletter.models";
|
||||||
import cloneDeep from "lodash.clonedeep";
|
import cloneDeep from "lodash.clonedeep";
|
||||||
import isEqual from "lodash.isequal";
|
import isEqual from "lodash.isequal";
|
||||||
import difference from "lodash.difference";
|
|
||||||
|
|
||||||
export const useNewsletterStore = defineStore("newsletter", {
|
export const useNewsletterStore = defineStore("newsletter", {
|
||||||
state: () => {
|
state: () => {
|
||||||
|
@ -72,7 +71,6 @@ export const useNewsletterStore = defineStore("newsletter", {
|
||||||
const result = await http.post(`/admin/newsletter`, {
|
const result = await http.post(`/admin/newsletter`, {
|
||||||
title: newsletter.title,
|
title: newsletter.title,
|
||||||
});
|
});
|
||||||
this.fetchNewsletters();
|
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
async synchronizeActiveNewsletter(): Promise<void> {
|
async synchronizeActiveNewsletter(): Promise<void> {
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import { defineStore } from "pinia";
|
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 { http } from "@/serverCom";
|
||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
import type { ProtocolViewModel } from "@/viewmodels/admin/club/protocol/protocol.models";
|
import type { ProtocolViewModel } from "@/viewmodels/admin/club/protocol/protocol.models";
|
||||||
import cloneDeep from "lodash.clonedeep";
|
import cloneDeep from "lodash.clonedeep";
|
||||||
import isEqual from "lodash.isequal";
|
import isEqual from "lodash.isequal";
|
||||||
import difference from "lodash.difference";
|
|
||||||
|
|
||||||
export const useProtocolStore = defineStore("protocol", {
|
export const useProtocolStore = defineStore("protocol", {
|
||||||
state: () => {
|
state: () => {
|
||||||
|
@ -73,7 +72,6 @@ export const useProtocolStore = defineStore("protocol", {
|
||||||
title: protocol.title,
|
title: protocol.title,
|
||||||
date: protocol.date,
|
date: protocol.date,
|
||||||
});
|
});
|
||||||
this.fetchProtocols();
|
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
async synchronizeActiveProtocol(): Promise<void> {
|
async synchronizeActiveProtocol(): Promise<void> {
|
||||||
|
|
|
@ -7,6 +7,7 @@ export interface NewsletterViewModel {
|
||||||
newsletterSignatur: string;
|
newsletterSignatur: string;
|
||||||
isSent: boolean;
|
isSent: boolean;
|
||||||
recipientsByQueryId?: string | null;
|
recipientsByQueryId?: string | null;
|
||||||
|
createdAt: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CreateNewsletterViewModel {
|
export interface CreateNewsletterViewModel {
|
||||||
|
|
Loading…
Add table
Reference in a new issue