@@ -22,9 +22,9 @@ const activitySchema = {
2222
2323const Activity = connector . model ( "Activity" , activitySchema ) ;
2424
25- ///crud operation///
25+ /// crud operation///
2626
27- //add a activity to the database
27+ // add a activity to the database
2828async function create ( activityData ) {
2929 const {
3030 activityBlueprint, startTime, duration, course, faculty, type, task, group, students,
@@ -36,25 +36,25 @@ async function create(activityData){
3636 return activityDoc ;
3737}
3838
39- //Retrieve activity based on a given filter and limit
39+ // Retrieve activity based on a given filter and limit
4040async function read ( filter , limit = 1 ) {
4141 const activityDoc = await Activity . find ( filter ) . limit ( limit ) ;
4242 return activityDoc ;
4343}
4444
45- //update activity based on a given filter
45+ // update activity based on a given filter
4646async function update ( filter , updateObject , options = { multi :true } ) {
4747 const updateActivity = await Activity . updateMany ( filter , { $set :updateObject } , options ) ;
4848return updateActivity . acknowledged ;
4949}
5050
51- //Delete activity based on a given filter
51+ // Delete activity based on a given filter
5252async function remove ( filter ) {
5353 const deleteActivity = await Activity . deleteMany ( filter ) . exec ( ) ;
54- return deleteActivity . acknowledged
54+ return deleteActivity . acknowledged ;
5555}
5656
57- //export crud functions
57+ // export crud functions
5858
5959export default {
6060 create, read, update, remove,
0 commit comments