File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -279,15 +279,27 @@ export default function Courses() {
279279 </ div >
280280 < div className = "flex gap-2 items-center" >
281281 < p className = "font-semibold" >
282- Course Code:
282+ Code:
283283 </ p >
284284 < p > { course . code } </ p >
285285 </ div >
286+ < div className = "flex gap-2 items-center" >
287+ < p className = "font-semibold" >
288+ Title :
289+ </ p >
290+ < p > { course . title } </ p >
291+ </ div >
292+ < div className = "flex gap-2 items-center" >
293+ < p className = "font-semibold" >
294+ Credits:
295+ </ p >
296+ < p > { course . credits } </ p >
297+ </ div >
286298 < div className = "flex gap-2 items-center" >
287299 < p className = "font-semibold" >
288300 Instructor:
289301 </ p >
290- < p > { course . instructorName } </ p >
302+ < p > { course . instructor } </ p >
291303 </ div >
292304 < div className = "flex gap-2 items-center" >
293305 < p className = "font-semibold" >
Original file line number Diff line number Diff line change @@ -2,26 +2,28 @@ import { toast } from 'react-hot-toast'
22import { api } from '../../../utils/api'
33
44interface Props {
5- title : string
5+ id : string
66 code : string
7- instructorName :string
8- isAnonymous : boolean
7+ title : string
8+ department : string
9+ credits : number
10+ instructor : string
911 refetch : Function
1012}
1113
1214export const addCourse = ( {
1315 title,
1416 code,
15- instructorName ,
16- isAnonymous ,
17+ instructor ,
18+ credits ,
1719 refetch,
1820} : Props ) => {
1921 toast . promise (
2022 api . post ( '/api/db/courses' , {
2123 title,
2224 code,
23- instructorName ,
24- isAnonymous ,
25+ instructor ,
26+ credits ,
2527 } ) ,
2628 {
2729 loading : 'Adding...' ,
Original file line number Diff line number Diff line change 11import { toast } from 'react-hot-toast'
22import { api } from '../../../utils/api'
33
4- export const deleteCourse = ( id : number , refetchCourses : Function ) => {
4+ export const deleteCourse = ( id : string , refetchCourses : Function ) => {
55 api . delete ( '/api/db/courses?id=' + id )
66 . then ( ( res ) => {
77 refetchCourses ( )
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { api } from '../../../utils/api'
33import { Dispatch , SetStateAction } from 'react'
44
55interface Props {
6- id : number
6+ id : string
77 setCount : Dispatch < SetStateAction < number > >
88 setIsUpvoted : Dispatch < SetStateAction < boolean > >
99}
Original file line number Diff line number Diff line change 11import { toast } from 'react-hot-toast'
22import { api } from '../../../utils/api'
3+ import { Bool } from 'aws-sdk/clients/clouddirectory'
34
45interface Props {
5- id : number
6- title : string
6+ id : string
77 code : string
8- isAnonymous : boolean
8+ title : string
9+ department : string
10+ credits : number
11+ instructor : string
912 refetch : Function
1013}
1114
1215export const updateCourse = ( {
1316 id,
1417 title,
1518 code,
16- isAnonymous ,
19+ credits ,
1720 refetch,
1821} : Props ) => {
1922 toast . promise (
2023 api . put ( '/api/db/courses?id=' + id , {
2124 title,
2225 code,
23- anonymous :isAnonymous ,
2426 } ) ,
2527 {
2628 loading : 'Updating...' ,
Original file line number Diff line number Diff line change 11export interface coursesColumnData {
2- sno : string
3- upvotes : number
2+ id :string
3+ // sno: string
4+ // upvotes: number
5+ credits :number
6+ instructor :string
7+ department :string
48 title : string
5- courseCode : string
6- uploadedBy : string
7- actions : JSX . Element
9+ code : string
10+ // uploadedBy: string
11+ // actions: JSX.Element
12+
813}
You can’t perform that action at this time.
0 commit comments