Merge branch 'feat/contacts-redesign' into feat/compose-new-conversation

This commit is contained in:
Sivin Varghese
2024-11-22 10:30:45 +05:30
committed by GitHub
9 changed files with 53 additions and 192 deletions
@@ -34,10 +34,11 @@ const portalLink = computed(() => {
);
});
const saveArticle = async ({ ...values }) => {
const saveArticle = async ({ ...values }, isAsync = false) => {
const actionToDispatch = isAsync ? 'articles/updateAsync' : 'articles/update';
isUpdating.value = true;
try {
await store.dispatch('articles/update', {
await store.dispatch(actionToDispatch, {
portalSlug,
articleId: articleSlug,
...values,
@@ -55,6 +56,10 @@ const saveArticle = async ({ ...values }) => {
}
};
const saveArticleAsync = async ({ ...values }) => {
saveArticle({ ...values }, true);
};
const isCategoryArticles = computed(() => {
return (
route.name === 'portals_categories_articles_index' ||
@@ -92,9 +97,7 @@ const previewArticle = () => {
});
};
onMounted(() => {
fetchArticleDetails();
});
onMounted(fetchArticleDetails);
</script>
<template>
@@ -103,6 +106,7 @@ onMounted(() => {
:is-updating="isUpdating"
:is-saved="isSaved"
@save-article="saveArticle"
@save-article-async="saveArticleAsync"
@preview-article="previewArticle"
@go-back="goBackToArticles"
/>