Content retrival on all pages
This commit is contained in:
17
src/routes/events/+page.server.js
Normal file
17
src/routes/events/+page.server.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { getFromCMS } from 'utils/utils.js';
|
||||
|
||||
// needs to concat and format this text
|
||||
const query = `*[_type == "events"]{
|
||||
name,
|
||||
category,
|
||||
date,
|
||||
location,
|
||||
description,
|
||||
"lastUpdated": _updatedAt,
|
||||
}`;
|
||||
|
||||
export const load = async () => {
|
||||
return {
|
||||
events: await getFromCMS(query)
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user