Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC-5829 - update mongoose for feathersjs 5 #4573

Merged
merged 48 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
dbb8b96
BC-5639 - update feathersjs to v5
SevenWaysDP Oct 27, 2023
4ffca6f
BC-5639 - WIP problems
SevenWaysDP Oct 27, 2023
3801f10
BC-5639 - fix configs
SevenWaysDP Oct 27, 2023
ea9daef
fixup! BC-5639 - fix configs
SevenWaysDP Oct 27, 2023
3cf4a9f
BC-5639 - fix binding of service
SevenWaysDP Oct 30, 2023
eeac174
BC-5639 - fix error
SevenWaysDP Oct 30, 2023
e354ba0
BC-5639 - update feathers-hooks-common
SevenWaysDP Oct 30, 2023
47c8a94
BC-5639 - temp fix compilations bug
SevenWaysDP Oct 30, 2023
a03c213
BC-5639 - fix error
SevenWaysDP Nov 1, 2023
1fabfc0
BC-5639 - fix test promise error
SevenWaysDP Nov 1, 2023
edb7e9f
BC-5639 - update express deps
SevenWaysDP Nov 1, 2023
5f313b2
BC-5639 - fix tests
SevenWaysDP Nov 3, 2023
22a1ba8
uncomment sync account functions
virgilchiriac Nov 3, 2023
8e1569c
some cleanup
virgilchiriac Nov 14, 2023
11f85a1
Merge branch 'main' into bc-5639-poc-feathers-update
virgilchiriac Nov 14, 2023
7a9c7db
BC-5639 - try to fix calendar
virgilchiriac Nov 14, 2023
9d92307
BC-5639 - fix some tests
virgilchiriac Nov 16, 2023
a904613
BC-5639 - fix errors
virgilchiriac Nov 20, 2023
3d0a5f0
BC-5639 - skip oauth tests (service is fully migrated to nest)
virgilchiriac Nov 20, 2023
442d3ce
Merge branch 'main' into BC-5828-feathers-update
virgilchiriac Nov 22, 2023
d52b031
fix permission tests
virgilchiriac Nov 22, 2023
fe97c02
Merge branch 'main' into BC-5828-feathers-update
virgilchiriac Nov 22, 2023
7695f93
BC-5596 - port feathers-mongoose module to feathersjs version 5
SevenWaysDP Nov 10, 2023
6485f17
BC-5596 - replace feathers-mongoose
SevenWaysDP Nov 10, 2023
f6e12e1
BC-5829 - code review
SevenWaysDP Nov 23, 2023
15e90e6
BC-5829 - fix migrations changes to v6
SevenWaysDP Nov 23, 2023
74ab1cb
fixup! BC-5829 - fix migrations changes to v6
SevenWaysDP Nov 24, 2023
53fa31b
Merge branch 'main' into BC-5828-feathers-update
SevenWaysDP Nov 24, 2023
d77c34e
Merge branch 'BC-5828-feathers-update' into BC-5829-update-mongoose
SevenWaysDP Nov 24, 2023
2fa8ad0
fixup! fixup! BC-5829 - fix migrations changes to v6
SevenWaysDP Nov 24, 2023
14dff9e
BC-5829 - fix set id backward compatibility
SevenWaysDP Nov 28, 2023
1c713cb
BC-5829 - we need clarification
SevenWaysDP Dec 1, 2023
c7da379
BC-5829 - add tests for mongoose service
SevenWaysDP Dec 1, 2023
9feb35a
BC-5829 - code review
SevenWaysDP Dec 4, 2023
b866039
Merge remote-tracking branch 'origin/main' into BC-5829-update-mongoose
SevenWaysDP Dec 7, 2023
21fc8d8
BC-5829 - fix merge conflict
SevenWaysDP Dec 7, 2023
62a5f50
Merge remote-tracking branch 'origin/main' into BC-5829-update-mongoose
SevenWaysDP Dec 11, 2023
54c5478
BC-5829 - fix queries with multi param
SevenWaysDP Dec 12, 2023
8a8243a
fixup! BC-5829 - fix queries with multi param
SevenWaysDP Dec 12, 2023
9add2b4
fixup! fixup! BC-5829 - fix queries with multi param
SevenWaysDP Dec 12, 2023
7d6cd65
Merge branch 'main' into BC-5829-update-mongoose
SevenWaysDP Dec 12, 2023
f29ccfe
BC-5829 - revert strictPopulate
SevenWaysDP Dec 12, 2023
a5cc788
BC-5829 - add info
SevenWaysDP Dec 12, 2023
8b3590a
Merge branch 'main' into BC-5829-update-mongoose
SevenWaysDP Dec 12, 2023
c3444b2
Merge branch 'main' into BC-5829-update-mongoose
CeEv Dec 13, 2023
3c23c12
Merge remote-tracking branch 'origin/main' into BC-5829-update-mongoose
SevenWaysDP Dec 14, 2023
20862f2
BC-5829 - remove unimportant infos
SevenWaysDP Dec 14, 2023
ac3be67
BC-5829 - fix deps update
SevenWaysDP Dec 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
731 changes: 424 additions & 307 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@
},
"dependencies": {
"@aws-sdk/lib-storage": "^3.100.0",
"@feathersjs/adapter-commons": "^5.0.12",
"@feathersjs/authentication": "^5.0.12",
"@feathersjs/authentication-local": "^5.0.12",
"@feathersjs/commons": "^5.0.12",
"@feathersjs/configuration": "^5.0.12",
"@feathersjs/errors": "^5.0.12",
"@feathersjs/express": "^5.0.12",
Expand Down Expand Up @@ -172,7 +174,6 @@
"express-openapi-validator": "^4.13.2",
"express-session": "^1.17.3",
"feathers-hooks-common": "^8.1.1",
"feathers-mongoose": "^6.3.0",
"feathers-swagger": "^3.0.0",
"file-type": "^18.5.0",
"freeport": "^1.0.5",
Expand All @@ -189,7 +190,7 @@
"mixwith": "^0.1.1",
"moment": "^2.19.2",
"mongodb-uri": "^0.9.7",
"mongoose": "^5.13.20",
"mongoose": "^6.12.3",
"mongoose-delete": "^0.5.4",
"mongoose-id-validator": "^0.6.0",
"mongoose-lean-virtuals": "^0.8.1",
Expand Down Expand Up @@ -239,6 +240,7 @@
"devDependencies": {
"@aws-sdk/client-s3": "^3.352.0",
"@faker-js/faker": "^8.0.2",
"@feathersjs/adapter-tests": "^5.0.12",
"@golevelup/ts-jest": "^0.3.4",
"@jest-mock/express": "^1.4.5",
"@nestjs/cli": "^10.1.17",
Expand Down
2 changes: 1 addition & 1 deletion scripts/endLdapSchoolYear.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ appPromise
)
.exec();

info(`LDAP Schools ended their Maintenance mode: ${resultLdapSchools.nModified} schools updated`);
info(`LDAP Schools ended their Maintenance mode: ${resultLdapSchools.modifiedCount} schools updated`);

return process.exit(0);
})
Expand Down
4 changes: 2 additions & 2 deletions scripts/startNewSchoolYear.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ appPromise
{ inMaintenanceSince: MAINTENANCE_START_DATE }
)
.exec();
info(`LDAP Schools set in Maintenance mode: ${resultLdapSchools.nModified} schools updated`);
info(`LDAP Schools set in Maintenance mode: ${resultLdapSchools.modifiedCount} schools updated`);

const resultNonLdapSchools = await schoolModel
.updateMany(
Expand All @@ -50,7 +50,7 @@ appPromise
{ currentYear: nextSchoolYearId._id }
)
.exec();
info(`Non-LDAP Schools changed year: ${resultNonLdapSchools.nModified} schools updated`);
info(`Non-LDAP Schools changed year: ${resultNonLdapSchools.modifiedCount} schools updated`);
CeEv marked this conversation as resolved.
Show resolved Hide resolved

return process.exit(0);
})
Expand Down
33 changes: 17 additions & 16 deletions src/components/helper/repo.helper.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
const { error } = require('../../logger');

/**
* https://mongoosejs.com/docs/6.x/docs/migrating_to_6.html#mongodb-driver-40
* Converts an mongoose update many result to an internal TO
* @param {*} param0
* @param {1|0} param0.ok 0 for error
* @param {Integer} param0.n Number of elements matched the given filter
* @param {Integer} param0.nModified Number of elements updated
* @param {Integer} matchedCount; // Number of documents matched
* @param {Integer} modifiedCount; // Number of documents modified
* @param {Boolean} acknowledged; // Boolean indicating everything went smoothly.
* @param {null|string} upsertedId; // null or an id containing a document that had to be upserted.
* @param {Integer} upsertedCount; // Number indicating how many documents had to be upserted. Will either be 0 or 1.
*/
const updateManyResult = ({ ok, n, nModified }) => {
if (ok !== 1) {
error('mongoose updateMany has failed', { ok, n, nModified });
const updateManyResult = ({ acknowledged, matchedCount, modifiedCount }) => {
if (acknowledged) {
error('mongoose updateMany has failed', { acknowledged, matchedCount, modifiedCount });
}
return { success: ok === 1, modifiedDocuments: nModified };
return { success: acknowledged, modifiedDocuments: modifiedCount };
};

/**
* https://mongoosejs.com/docs/6.x/docs/migrating_to_6.html#mongodb-driver-40
* Converts an mongoose delete many result to an internal TO
* @param {*} param0
* @param {1|0} param0.ok 0 for error
* @param {Integer} param0.n Number of elements matched the given filter
* @param {Integer} param0.deletedCount Number of elements deleted
* @param {Boolean} acknowledged; // Boolean indicating everything went smoothly.
* @param {Integer} deletedCount Number of elements deleted
*/
const deleteManyResult = ({ ok, n, deletedCount }) => {
if (ok !== 1) {
error('mongoose deleteMany has failed', { ok, n, deletedCount });
const deleteManyResult = ({ acknowledged, deletedCount }) => {
if (!acknowledged) {
error('mongoose deleteMany has failed', { acknowledged, deletedCount });
}
return { success: ok === 1, deletedDocuments: deletedCount };
return { success: acknowledged, deletedDocuments: deletedCount };
};
module.exports = { updateManyResult, deleteManyResult };
2 changes: 1 addition & 1 deletion src/components/task/repo/task.repo.integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const db = {};
// TODO move to homeworks/submission repository, test it there and reuse it here only
db.findHomeworks = (userId) => HomeworkModel.find({ teacherId: userId }).lean().exec();
db.findGroupSubmissions = (userId) => SubmissionModel.find({ teamMembers: userId }).lean().exec();
db.findSubmissions = (userId) => SubmissionModel.find({ stundentId: userId }).lean().exec();
db.findSubmissions = (userId) => SubmissionModel.find({ studentId: userId }).lean().exec();
db.findArchivedHomework = (userId) => HomeworkModel.find({ archived: userId }).lean().exec();
// TODO find solution without cleanup it before
db.cleanupUnexpectedHomeworks = () =>
Expand Down
4 changes: 2 additions & 2 deletions src/components/user/repo/user.repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ const replaceUserWithTombstone = async (id, replaceData = {}) => {
)
.lean()
.exec();
if (replaceResult.n !== 1) {
if (replaceResult.modifiedCount !== 1) {
throw new NotFound('could not find user to replace with tombstone');
}
if (replaceResult.ok !== 1 || replaceResult.nModified !== 1) {
if (!replaceResult.acknowledged || replaceResult.modifiedCount !== 1) {
throw new GeneralError('db error during replacement of user with tombstone');
}
return getUser(id);
Expand Down
1 change: 1 addition & 0 deletions src/hooks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ exports.enableQuery = (context) => {
if (context.id) {
context.params.query = context.params.query || {};
context.params.query._id = context.id;
context.params.adapter = { multi: ['patch', 'remove'] };
context.id = null;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/services/activation/services/ActivationModelService.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const feathersMongooseService = require('feathers-mongoose');
const feathersMongooseService = require('../../../utils/feathers-mongoose');
const auth = require('@feathersjs/authentication');
const { iff, isProvider, disallow } = require('feathers-hooks-common');
const { activationModel } = require('../model');
Expand Down
28 changes: 11 additions & 17 deletions src/services/activation/utils/generalUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const STATE = {
*/
const deleteEntry = async (ref, entryId) => {
try {
const res = await (ref.app || ref).service('activationModel').remove({ _id: entryId });
const res = await (ref.app || ref).service('activationModel').remove(entryId);
return res;
} catch (error) {
/* eslint-disable-next-line */
Expand All @@ -42,14 +42,11 @@ const deleteEntry = async (ref, entryId) => {
* @returns {Object} changed entry
*/
const setEntryState = async (ref, entryId, state) => {
const entry = await (ref.app || ref).service('activationModel').patch(
{ _id: entryId },
{
$set: {
state,
},
}
);
const entry = await (ref.app || ref).service('activationModel').patch(entryId, {
$set: {
state,
},
});
return entry;
};

Expand Down Expand Up @@ -166,14 +163,11 @@ const sendMail = async (ref, mail, entry) => {
content: mail.content,
});

await ref.app.service('activationModel').patch(
{ _id: entry._id },
{
$push: {
mailSent: Date.now(),
},
}
);
await ref.app.service('activationModel').patch(entry._id, {
$push: {
mailSent: Date.now(),
},
});
} catch (error) {
if (entry.mailSent.length === 0) await deleteEntry(ref, entry._id);
throw new Error('Can not send mail with activation link');
Expand Down
2 changes: 1 addition & 1 deletion src/services/base64Files/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');

Expand Down
2 changes: 1 addition & 1 deletion src/services/consent/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');

Expand Down
2 changes: 1 addition & 1 deletion src/services/content/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// eslint-disable-next-line max-classes-per-file
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');
const material = require('./material-model');
Expand Down
2 changes: 1 addition & 1 deletion src/services/datasources/services/datasources.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const Ajv = require('ajv');
const service = require('feathers-mongoose');
const service = require('../../../utils/feathers-mongoose');
const { authenticate } = require('@feathersjs/authentication');
const { iff, isProvider, validateSchema, disallow } = require('feathers-hooks-common');
const { datasourceModel } = require('../model');
Expand Down
2 changes: 1 addition & 1 deletion src/services/federalState/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');

Expand Down
2 changes: 1 addition & 1 deletion src/services/fileStorage/model-service.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { FileModel } = require('./model');
const hooks = require('./hooks/model-hooks');

Expand Down
2 changes: 1 addition & 1 deletion src/services/helpdesk/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');

Expand Down
2 changes: 1 addition & 1 deletion src/services/homework/model-service.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { homeworkModel, submissionModel } = require('./model');
const hooks = require('./hooks');
const submissionHooks = require('./hooks/submissions');
Expand Down
2 changes: 1 addition & 1 deletion src/services/lesson/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');

Expand Down
2 changes: 1 addition & 1 deletion src/services/link/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable max-classes-per-file */
const { Configuration } = require('@hpi-schul-cloud/commons');
const queryString = require('qs');
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');
const { BadRequest } = require('@feathersjs/errors');
Expand Down
2 changes: 1 addition & 1 deletion src/services/ltiTool/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { authenticate } = require('@feathersjs/authentication');
const fs = require('fs');
const jwt = require('jsonwebtoken');
Expand Down
1 change: 1 addition & 0 deletions src/services/news/events/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const removeTeamNews = (app) => async (deletedTeam) => {
target: deletedTeam._id,
targetModel: 'teams',
},
adapter: { multi: ['remove'] },
});
} catch (e) {
logger.warning(`Cannot remove news for team ${deletedTeam._id}`, e);
Expand Down
2 changes: 1 addition & 1 deletion src/services/news/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* The public API has been moved to apps/server/src/modules/news
*/

const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');

const { newsModel } = require('./model');
const newsModelHooks = require('./hooks/newsModel.hooks');
Expand Down
2 changes: 1 addition & 1 deletion src/services/pseudonym/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');

Expand Down
2 changes: 1 addition & 1 deletion src/services/releases/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const request = require('request-promise-native');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');
Expand Down
2 changes: 1 addition & 1 deletion src/services/role/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');

Expand Down
2 changes: 1 addition & 1 deletion src/services/school/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { Configuration } = require('@hpi-schul-cloud/commons');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');
Expand Down
2 changes: 1 addition & 1 deletion src/services/serviceTemplate/services/modelService.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../../utils/feathers-mongoose');
const Ajv = require('ajv');
const auth = require('@feathersjs/authentication');
const { iff, isProvider, validateSchema, disallow } = require('feathers-hooks-common');
Expand Down
2 changes: 1 addition & 1 deletion src/services/storageProvider/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');

Expand Down
1 change: 1 addition & 0 deletions src/services/sync/strategies/TSP/SchoolChange.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const grantAccessToPrivateFiles = async (app, oldUser, newUser) => {
refOwnerModel: 'user',
owner: oldUser._id,
},
adapter: { multi: ['patch'] },
};
const updateData = {
owner: newUser._id,
Expand Down
2 changes: 1 addition & 1 deletion src/services/system/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');

Expand Down
2 changes: 1 addition & 1 deletion src/services/teams/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const getTeam = (refClass, teamId) => {
// todo: app to this -> this.app
const populateParams = {
query: {
$populate: [{ path: 'roles' }, { path: 'userIds.userId' }],
$populate: [{ path: 'userIds.userId' }],
},
};
return refClass.app
Expand Down
2 changes: 1 addition & 1 deletion src/services/teams/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// eslint-disable-next-line max-classes-per-file
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { Configuration } = require('@hpi-schul-cloud/commons');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');
Expand Down
1 change: 1 addition & 0 deletions src/services/teams/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const teamsSchema = getUserGroupSchema({
color: { type: String, default: '#ACACAC' },
features: [{ type: String, enum: Object.values(TEAM_FEATURES) }],
filePermission: [permissionSchema],
ltiToolIds: [{ type: Schema.Types.ObjectId, required: true, ref: 'ltiTool' }],
CeEv marked this conversation as resolved.
Show resolved Hide resolved
});

/*
Expand Down
2 changes: 1 addition & 1 deletion src/services/user-group/hooks/courses.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const _ = require('lodash');
const { Configuration } = require('@hpi-schul-cloud/commons/lib');
const { service } = require('feathers-mongoose');
const { service } = require('../../../utils/feathers-mongoose');

const { BadRequest } = require('../../../errors');
const globalHooks = require('../../../hooks');
Expand Down
2 changes: 1 addition & 1 deletion src/services/user-group/services/classModelService.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../../utils/feathers-mongoose');
const { iff, isProvider, disallow } = require('feathers-hooks-common');
const auth = require('@feathersjs/authentication');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../../utils/feathers-mongoose');
const { iff, isProvider, disallow } = require('feathers-hooks-common');
const auth = require('@feathersjs/authentication');

Expand Down
2 changes: 1 addition & 1 deletion src/services/user-group/services/courseModelService.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const service = require('feathers-mongoose');
const service = require('../../../utils/feathers-mongoose');
const { iff, isProvider, disallow } = require('feathers-hooks-common');
const auth = require('@feathersjs/authentication');

Expand Down
2 changes: 1 addition & 1 deletion src/services/user/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const hooks = require('feathers-hooks-common');
const service = require('feathers-mongoose');
const service = require('../../utils/feathers-mongoose');
const { static: staticContent } = require('@feathersjs/express');
const path = require('path');

Expand Down
1 change: 1 addition & 0 deletions src/services/user/services/AdminUsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class AdminUsers {
await this.updateAccount(email, _id);
}

params.adapter = { multi: ['patch'] };
// _id is part of params and will be combined with the schoolId
const createdUsers = await this.prepareRoleback(email, _id, () =>
this.app.service('usersModel').patch(null, _data, params)
Expand Down
Loading
Loading