From eb51f85db8cf4cac19cdccebcf8da61e172219ed Mon Sep 17 00:00:00 2001 From: Manuel Odelain Date: Mon, 25 Mar 2024 15:27:09 +0100 Subject: [PATCH] feat: optional path for useRoadizWebResponse() --- composables/use-roadiz-web-response.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/composables/use-roadiz-web-response.ts b/composables/use-roadiz-web-response.ts index 1b34093..0954fd1 100644 --- a/composables/use-roadiz-web-response.ts +++ b/composables/use-roadiz-web-response.ts @@ -1,6 +1,9 @@ import type { RoadizWebResponse } from '@roadiz/types' +import { joinURL } from 'ufo' + +export async function useRoadizWebResponse(path?: string) { + path = joinURL('/', path || useRoute().path) -export async function useRoadizWebResponse(path: string) { const fetch = useRoadizFetchFactory() const { data } = await useAsyncData(async () => { try {