Skip to content

Commit

Permalink
feat: deployment changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratham-Mishra04 committed Jun 7, 2023
1 parent 4a11cbe commit 8c1bf36
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
8 changes: 8 additions & 0 deletions src/models/teamModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ export interface TeamDocument extends TeamType, mongoose.Document {
}

export interface SubmissionPopulatedTeam {
_id: string;
id: mongoose.Schema.Types.ObjectId;
title: string;
members: UserDocument[];
submission: SubmissionDocument;
}

export interface SubmissionTypeTeam {
_id: string;
id: mongoose.Schema.Types.ObjectId;
title: string;
Expand Down
19 changes: 13 additions & 6 deletions src/pages/hack/admin/team/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import Image from 'next/image';
import Loader from '@/components/common/loader';
import { getSession, useSession } from 'next-auth/react';
import mongoose from 'mongoose';
import { SubmissionPopulatedTeam, TeamType } from '@/models/teamModel';
import {
SubmissionPopulatedTeam,
SubmissionTypeTeam,
TeamType,
} from '@/models/teamModel';
import Toaster from '@/utils/toaster';
import ViewSubmission from '@/sections/admin-page-sections/admin-view-submission';
import Header from '@/components/common/header';
Expand All @@ -20,7 +24,7 @@ interface Props {
}

const ProjectReviewPage = ({ id }: Props) => {
const [teamDetails, setTeamDetails] = useState<SubmissionPopulatedTeam>({
const [teamDetails, setTeamDetails] = useState<SubmissionTypeTeam>({
id: new mongoose.Schema.Types.ObjectId(''),
title: '',
members: [],
Expand Down Expand Up @@ -91,10 +95,13 @@ const ProjectReviewPage = ({ id }: Props) => {
}
let formData = {};

if (teamDetails.submission.status !== CURRENT_ROUND - 1) {
Toaster.error('Invalid Submission.');
return;
}
alert(teamDetails.submission.status);

// if (teamDetails.submission.status !== CURRENT_ROUND - 1)
// if (teamDetails.submission.status !== CURRENT_ROUND) {
// Toaster.error('Invalid Submission.');
// return;
// }
if (CURRENT_ROUND === 1)
formData = {
round1Score: score,
Expand Down

0 comments on commit 8c1bf36

Please sign in to comment.