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

+2 -2
View File
@@ -24,7 +24,7 @@ var (
allCharSet = lowerCharSet + upperCharSet + specialCharSet + numberSet
)
var teacherCollection *mongo.Collection = database.OpenCollection(database.Client, "teachers")
var TeacherCollection *mongo.Collection = database.OpenCollection(database.Client, "teachers")
type Teacher struct {
ID primitive.ObjectID `bson:"_id"`
@@ -73,7 +73,7 @@ func (t *Teacher) HashPassword(password string) string {
func (t *Teacher) EmailExists(email string) bool {
var teacher Teacher
findErr := teacherCollection.FindOne(context.TODO(), bson.M{"accountdata.schoolemail": email}).Decode(&teacher)
findErr := TeacherCollection.FindOne(context.TODO(), bson.M{"accountdata.schoolemail": email}).Decode(&teacher)
if findErr != nil {
return false
}