-
Notifications
You must be signed in to change notification settings - Fork 0
Added last updated time for OH #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,8 @@ const homepageQuery = `{ | |
| name, | ||
| url, | ||
| "logo": logo.asset->url+"?h=100&fm=webp" | ||
| } | ||
| }, | ||
| "_lastUpdated": *[_type=="officeHours"] | order(_updatedAt desc)[0]._updatedAt | ||
| }`; | ||
|
|
||
| export const load = async ({ url }) => { | ||
|
|
@@ -36,6 +37,7 @@ export const load = async ({ url }) => { | |
| councilPhoto: councilPhotoUrl, | ||
| allOHs: officeHourResp, | ||
| sponsors: sponsorsResp, | ||
| canonical: url.href | ||
| canonical: url.href, | ||
| ohLastUpdated: homePageResp._lastUpdated ?? null | ||
|
||
| }; | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're renaming the variable, you can change "_lastUpdated" to a more descriptive name. I suggest "ohLastUpdated" and also put it between Line 17 and 18 so it's next to the fetching OH query.
ECSESS/src/routes/+page.server.ts
Lines 9 to 18 in 9b93464
Great use of the pipe/order functions! I didn't know Sanity can do that