transfer update controllers to own files

This commit is contained in:
SowinskiBraeden committed 2022-08-14 11:49:01 -07:00
1 parent 1b643c0bc2
commit d7d19ffb2d
11 files changed
+2708 -2651

No files matched your search

+3 -3
View File
@@ -18,8 +18,8 @@ import (
"go.mongodb.org/mongo-driver/mongo"
)
var lockerCollection *mongo.Collection = database.OpenCollection(database.Client, "lockers")
var studentCollection *mongo.Collection = database.OpenCollection(database.Client, "students")
var LockerCollection *mongo.Collection = database.OpenCollection(database.Client, "lockers")
var StudentCollection *mongo.Collection = database.OpenCollection(database.Client, "students")
type Student struct {
ID primitive.ObjectID `bson:"_id"`
@@ -75,7 +75,7 @@ func (s *Student) HashPassword(password string) string {
func (s *Student) EmailExists(email string) bool {
var student Student
findErr := studentCollection.FindOne(context.TODO(), bson.M{"accountdata.schoolemail": email}).Decode(&student)
findErr := StudentCollection.FindOne(context.TODO(), bson.M{"accountdata.schoolemail": email}).Decode(&student)
if findErr != nil {
return false
}