I am using the started template generously provided by @torpid mica https://github.com/Lambdo-Labs/payloadcms-astro-template
but cant figure out the code i need to write to get Paylod globals come up in Astro...
i tried to add this into the Astro api.ts:
const stringifiedQuery = qs.stringify(
query,
{ addQueryPrefix: true }
);
const brandingData = await apiFetch(
${import.meta.env.PAYLOAD_URL}/api/globals/brand-details${stringifiedQuery}
)
return brandingData
}
i also added this to types.ts:
//globals
export interface PayloadGlobal<GlobalType> {
totalDocs: number
docs: GlobalType[]
limit: number
}
is this the right way?