MCPcopy Create free account
hub / github.com/Creatly/creatly-backend / AddLesson

Method AddLesson

internal/repository/modules_mongo.go:118–122  ·  view source on GitHub ↗
(ctx context.Context, schoolId, id primitive.ObjectID, lesson domain.Lesson)

Source from the content-addressed store, hash-verified

116}
117
118func (r *ModulesRepo) AddLesson(ctx context.Context, schoolId, id primitive.ObjectID, lesson domain.Lesson) error {
119 _, err := r.db.UpdateOne(ctx, bson.M{"_id": id, "schoolId": schoolId}, bson.M{"$push": bson.M{"lessons": lesson}})
120
121 return err
122}
123
124func (r *ModulesRepo) GetByLesson(ctx context.Context, lessonId primitive.ObjectID) (domain.Module, error) {
125 var module domain.Module

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected