Page: Only show a page from the public category - refs BT#21600

pull/5458/head
Angel Fernando Quiroz Campos 7 months ago
parent 46839f80a6
commit cc87f7ba8f
  1. 6
      assets/vue/services/pageService.js
  2. 2
      assets/vue/views/page/PagePublic.vue

@ -5,8 +5,8 @@ import baseService from "./baseService"
* @param {string} slug
* @returns {Promise<Object|null>}
*/
async function getBySlug(slug) {
const { items } = await baseService.getCollection("/api/pages", { slug })
async function getPublicPageBySlug(slug) {
const { items } = await baseService.getCollection("/api/pages", { slug, "category.title": "public" })
if (items.length) {
return items[0]
@ -16,7 +16,7 @@ async function getBySlug(slug) {
}
export default {
getBySlug,
getPublicPageBySlug,
/**
* @param {Object} params

@ -15,7 +15,7 @@ const isLoading = ref(true)
const page = ref()
pageService
.getBySlug(route.params.slug)
.getPublicPageBySlug(route.params.slug)
.then((result) => {
if (result) {
page.value = result

Loading…
Cancel
Save