+ {#each ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'] as day}
- {DOTW}
- {#each sortedOHs.filter((OH) => OH.day == DOTW) as OH}
-
+
- {day} -
+ {#each sortedOHs.filter((OH) => OH.day == day) as OH}
+
+
{OH.startTime} - {OH.endTime}
+
{OH.member.name.split(" ")[0]}
+
{OH.member.position}
+
{/each}
{/each}
diff --git a/src/lib/schemas.ts b/src/lib/schemas.ts
index 8cbb55e..605e69a 100644
--- a/src/lib/schemas.ts
+++ b/src/lib/schemas.ts
@@ -1,4 +1,4 @@
-export interface EventPost {
+export type EventPost = {
id: string;
title: string;
description: string;
@@ -9,16 +9,7 @@ export interface EventPost {
link: string;
category: string;
payment: string; // event payment link (e.g., Zeffy)
-}
-
-export interface CouncilMember {
- role: string;
- name: string;
- email: string;
- image: string;
- major: string;
- year: string;
-}
+};
import type { InputValue } from '@portabletext/svelte';
@@ -35,8 +26,19 @@ export type OhCMSResponse = {
day: string;
startTime: string;
endTime: string;
- host: {
+ member: {
name: string;
position: string;
};
}[];
+
+export type CouncilMember = {
+ name: string;
+ email: string;
+ position: string;
+ positionDescription: string;
+ image: string; // URL
+ yearProgram: string;
+};
+
+export type Redirect = { shortname: string; url: string };
diff --git a/src/utils/utils.js b/src/lib/utils.js
similarity index 100%
rename from src/utils/utils.js
rename to src/lib/utils.js
diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts
index afcd625..e7f4a6d 100644
--- a/src/routes/+page.server.ts
+++ b/src/routes/+page.server.ts
@@ -1,4 +1,4 @@
-import { getFromCMS } from 'utils/utils.js';
+import { getFromCMS } from '$lib/utils.js';
import type { HomepageCMSResponse, OhCMSResponse } from '$lib/schemas';
const homepageQuery = `*[_type == "homepage"]{
diff --git a/src/routes/council/+page.server.js b/src/routes/council/+page.server.ts
similarity index 89%
rename from src/routes/council/+page.server.js
rename to src/routes/council/+page.server.ts
index c9fce06..d4a5936 100644
--- a/src/routes/council/+page.server.js
+++ b/src/routes/council/+page.server.ts
@@ -1,4 +1,4 @@
-import { getFromCMS } from 'utils/utils.js';
+import { getFromCMS } from '$lib/utils.js';
const query = `*[_type == "members"]{
name,
diff --git a/src/routes/events/+page.server.ts b/src/routes/events/+page.server.ts
index d73c5bb..4cf80bb 100644
--- a/src/routes/events/+page.server.ts
+++ b/src/routes/events/+page.server.ts
@@ -1,4 +1,4 @@
-import { getFromCMS } from 'utils/utils.js';
+import { getFromCMS } from '$lib/utils.js';
// needs to concat and format this text
const eventQuery = `*[_type == "events"]{
diff --git a/src/routes/r/[shortname]/+page.server.js b/src/routes/r/[shortname]/+page.server.js
deleted file mode 100644
index 68be477..0000000
--- a/src/routes/r/[shortname]/+page.server.js
+++ /dev/null
@@ -1,23 +0,0 @@
-import { redirect } from '@sveltejs/kit';
-import { getFromCMS } from 'utils/utils.js';
-
-const redirectQuery = `*[_type == "redirects"]{ shortname, url }`;
-
-export const load = async ({ params }) => {
- /** @type {[{shortname: String, url: String}]} */
- let CMSresponse = await getFromCMS(redirectQuery);
-
- const { shortname } = params;
-
- CMSresponse.forEach(res => {
- if(res.shortname == shortname) {
- // if match
- throw redirect(302, res.url);
- }
- });
-
- return {
- shortname: shortname,
- availableShortnames: CMSresponse,
- }
-};
diff --git a/src/routes/r/[shortname]/+page.server.ts b/src/routes/r/[shortname]/+page.server.ts
new file mode 100644
index 0000000..9620ed5
--- /dev/null
+++ b/src/routes/r/[shortname]/+page.server.ts
@@ -0,0 +1,23 @@
+import { redirect } from '@sveltejs/kit';
+import { getFromCMS } from '$lib/utils.js';
+import type { Redirect } from '$lib/schemas';
+
+const redirectQuery = `*[_type == "redirects"]{ shortname, url }`;
+
+export const load = async ({ params }) => {
+ let CMSresponse: Redirect[] = await getFromCMS(redirectQuery);
+
+ const { shortname } = params;
+
+ CMSresponse.forEach((res) => {
+ if (res.shortname == shortname) {
+ // if match
+ throw redirect(302, res.url);
+ }
+ });
+
+ return {
+ shortname: shortname,
+ availableShortnames: CMSresponse
+ };
+};
diff --git a/src/routes/resources/+page.server.js b/src/routes/resources/+page.server.js
index e983751..3d1dfea 100644
--- a/src/routes/resources/+page.server.js
+++ b/src/routes/resources/+page.server.js
@@ -1,4 +1,4 @@
-import { getFromCMS } from 'utils/utils.js';
+import { getFromCMS } from '$lib/utils.js';
// needs to concat and format this text
const query = `*[_type == "resources"]{
diff --git a/src/utils/schemas.ts b/src/utils/schemas.ts
deleted file mode 100644
index 592f756..0000000
--- a/src/utils/schemas.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export default interface CouncilMember {
- name: string;
- email: string;
- position: string;
- positionDescription: string;
- image: string; // URL
- yearProgram: string;
-}