From 67988d5cefa9a7bfe4809d1f839d39ff1f7e6c79 Mon Sep 17 00:00:00 2001 From: IshavSohal Date: Wed, 27 Nov 2024 16:14:31 -0500 Subject: [PATCH] add functionality to edit button, sort products by last modified --- src/components/home.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/home.vue b/src/components/home.vue index 6730e219..4087849e 100644 --- a/src/components/home.vue +++ b/src/components/home.vue @@ -137,6 +137,7 @@ min-width: 0; max-width: 100%; " + @click="editProduct(storyline.uuid)" > { - return this.profile?.storylines || {}; + return this.profile?.storylines?.sort((a, b) => new Date(b.lastModified) - new Date(a.lastModified)) || {}; } dateFormatter(date: string | null): string { @@ -217,6 +219,10 @@ export default class HomeV extends Vue { } } } + + editProduct(uuid: number): void { + this.$router.push({ name: 'editor', params: { uid: uuid } }); + } }