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

fix: API v3 Page update #9053

Merged
merged 7 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions apps/app/src/server/models/user-group-relation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ schema.statics.findAllRelationForUserGroups = function(userGroups) {
* @memberof UserGroupRelation
*/
schema.statics.findAllGroupsForUser = async function(user): Promise<UserGroupDocument[]> {
const userGroupRelations = await this.find({ relatedUser: user.id }).populate('relatedGroup');
const userGroupRelations = await this.find({ relatedUser: user._id }).populate('relatedGroup');
const userGroups = userGroupRelations.map((relation) => {
return isPopulated(relation.relatedGroup) ? relation.relatedGroup as UserGroupDocument : null;
});
Expand Down Expand Up @@ -161,7 +161,7 @@ schema.statics.findAllUserGroupIdsRelatedToUser = async function(user): Promise<
schema.statics.countByGroupIdsAndUser = async function(userGroupIds: ObjectIdLike[], userData): Promise<number> {
const query = {
relatedGroup: { $in: userGroupIds },
relatedUser: userData.id,
relatedUser: userData._id,
};

return this.count(query);
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/server/util/compare-objectId.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import mongoose from 'mongoose';

import { ObjectIdLike } from '~/server/interfaces/mongoose-utils';
import type { ObjectIdLike } from '~/server/interfaces/mongoose-utils';

type IObjectId = mongoose.Types.ObjectId;
const ObjectId = mongoose.Types.ObjectId;
Expand Down
Loading