Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pages/admin/actions/[id].js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { getSession } from 'next-auth/react';
import Navbar from '../../../components/navbar';
import UpdateUserForm from '../../../components/updateUserForm';
import prisma from '../../../prisma/prisma';
import redirectUser from '../../../util/redirectUser.js';

export async function getServerSideProps(context) {
// Dynamic import to prevent Prisma from being bundled for client
const { default: prisma } = await import('../../../prisma/prisma');

const userSession = await getSession(context);
if (!userSession) {
return redirectUser('/error');
Expand Down
4 changes: 3 additions & 1 deletion pages/admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import styles from '../../styles/Home.module.css';
import Navbar from '../../components/navbar';
import Link from 'next/link';
import { getSession } from 'next-auth/react';
import prisma from '../../prisma/prisma';
import dynamic from 'next/dynamic';
import redirectUser from '../../util/redirectUser.js';

export async function getServerSideProps(ctx) {
// Dynamic import to prevent Prisma from being bundled for client
const { default: prisma } = await import('../../prisma/prisma');

const userSession = await getSession(ctx);
if (!userSession) {
return redirectUser('/error');
Expand Down
4 changes: 3 additions & 1 deletion pages/classes/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import prisma from '../../prisma/prisma';
import ClassInviteTable from '../../components/ClassInviteTable';
import Head from 'next/head';
import Navbar from '../../components/navbar';
Expand All @@ -11,6 +10,9 @@ import { useState } from 'react';
import redirectUser from '../../util/redirectUser.js';

export async function getServerSideProps(ctx) {
// Dynamic import to prevent Prisma from being bundled for client
const { default: prisma } = await import('../../prisma/prisma');

const userSession = await getSession(ctx);
if (!userSession) {
return redirectUser('/error');
Expand Down
4 changes: 3 additions & 1 deletion pages/dashboard/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Head from 'next/head';
import Layout from '../../components/layout';
import Link from 'next/link';
import Navbar from '../../components/navbar';
import prisma from '../../prisma/prisma';
import DashTabs from '../../components/dashtabs';
import { getSession } from 'next-auth/react';
import {
Expand All @@ -15,6 +14,9 @@ import {
import redirectUser from '../../util/redirectUser.js';

export async function getServerSideProps(context) {
// Dynamic import to prevent Prisma from being bundled for client
const { default: prisma } = await import('../../prisma/prisma');

//making sure User is the teacher of this classsroom's dashboard
const userSession = await getSession(context);
if (!userSession) {
Expand Down
4 changes: 3 additions & 1 deletion pages/dashboard/v2/[id].js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Head from 'next/head';
import Layout from '../../../components/layout';
import Link from 'next/link';
import prisma from '../../../prisma/prisma';
import Navbar from '../../../components/navbar';
import { getSession } from 'next-auth/react';
import GlobalDashboardTable from '../../../components/dashtable_v2';
Expand All @@ -17,6 +16,9 @@ import {
import redirectUser from '../../../util/redirectUser.js';

export async function getServerSideProps(context) {
// Dynamic import to prevent Prisma from being bundled for client
const { default: prisma } = await import('../../../prisma/prisma');

//making sure User is the teacher of this classsroom's dashboard
const userSession = await getSession(context);
if (!userSession) {
Expand Down
4 changes: 3 additions & 1 deletion pages/dashboard/v2/details/[id]/[studentEmail].js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Head from 'next/head';
import Layout from '../../../../../components/layout';
import Link from 'next/link';
import prisma from '../../../../../prisma/prisma';
import Navbar from '../../../../../components/navbar';
import { getSession } from 'next-auth/react';
import {
Expand All @@ -17,6 +16,9 @@ import styles from '../../../../../components/DetailsCSS.module.css';
import DetailsDashboard from '../../../../../components/DetailsDashboard';

export async function getServerSideProps(context) {
// Dynamic import to prevent Prisma from being bundled for client
const { default: prisma } = await import('../../../../../prisma/prisma');

//making sure User is the teacher of this classsroom's dashboard
const userSession = await getSession(context);

Expand Down
Loading