@@ -805,8 +805,8 @@ def deleteOpportunity(opportunity_id):
805805
806806 return {"data" : "Opportunity Deleted" }
807807
808- # Return opportunity data
809- @main_blueprint .get ("/OpportunityRoute/<int:opportunity_id>" )
808+ # Return all opportunity data
809+ @main_blueprint .get ("/OpportunityRoute/<int:opportunity_id>" )
810810@jwt_required ()
811811def get_opportunity (opportunity_id ):
812812 # Get current user ID from JWT
@@ -835,11 +835,7 @@ def get_opportunity(opportunity_id):
835835 .where (Leads .lab_manager_id == user .lab_manager_id )
836836 ).scalar_one_or_none ()
837837
838- # Might need
839- author = db .session .execute (
840- db .select (User ).where (User .email == user_id [0 ])
841- ).scalar_one_or_none ()
842-
838+ #red_major, rec_courses, rec_class_years
843839 rec_major = db .session .execute (
844840 db .select (RecommendsMajors ).where (RecommendsMajors .opportunity_id == opportunity_id )
845841 ).scalar_one_or_none ()
@@ -867,12 +863,15 @@ def get_opportunity(opportunity_id):
867863 },
868864 "semester" : opportunity .semester ,
869865 "year" : opportunity .year ,
870- "application_due" : opportunity .application_due .isoformat () if opportunity .application_due else None ,
866+ "application_due" :
867+ (opportunity .application_due .isoformat () if opportunity .application_due else None ),
871868 "active" : opportunity .active ,
872- "location" : opportunity .location .name if opportunity .location else None ,
873- "last_updated" : opportunity .last_updated .isoformat () if opportunity .last_updated else None ,
874- "lab_managers" : labManager is not None ,
875- "author" : author .id ,
869+ "location" :
870+ (opportunity .location .name if opportunity .location else None ),
871+ "last_updated" :
872+ (opportunity .last_updated .isoformat () if opportunity .last_updated else None ),
873+ "is_there_lab_managers" : labManager is not None ,
874+ "lab_managers_id" : labManager .id ,
876875 "rec_major" : rec_major .major_code ,
877876 "rec_course" : rec_course .course_code ,
878877 "rec_class_years" : rec_class_years .class_years
0 commit comments