CMS fetching, Main page & members page (#12)
* CMS fetching on main page * Getting council members * Image loading for council member * Placeholder avatar
This commit is contained in:
18
src/utils/utils.js
Normal file
18
src/utils/utils.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import { createClient } from '@sanity/client';
|
||||
import { SANITY_ID } from '$env/static/private';
|
||||
|
||||
const client = createClient({
|
||||
projectId: SANITY_ID,
|
||||
dataset: 'production',
|
||||
useCdn: true,
|
||||
apiVersion: '2025-02-06'
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} query the GROQ query from Sanity CMS
|
||||
*/
|
||||
export async function getFromCMS(query) {
|
||||
return await client.fetch(query);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user