diff --git a/backend/user-service/src/models/user.model.ts b/backend/user-service/src/models/user.model.ts index d72e28c6bf..2232e19ab2 100644 --- a/backend/user-service/src/models/user.model.ts +++ b/backend/user-service/src/models/user.model.ts @@ -1,9 +1,9 @@ -import { Schema, model } from 'mongoose' +import { Schema } from 'mongoose' import { IUser } from '../types/IUser' import { Proficiency } from '../types/Proficiency' import { Role } from '../types/Role' -const UserSchema = new Schema({ +export default new Schema({ username: { type: String, required: true, @@ -43,5 +43,3 @@ const UserSchema = new Schema({ default: null, }, }) - -export default model('User', UserSchema) diff --git a/backend/user-service/src/models/user.repository.ts b/backend/user-service/src/models/user.repository.ts index c9d00c3cc8..164087c653 100644 --- a/backend/user-service/src/models/user.repository.ts +++ b/backend/user-service/src/models/user.repository.ts @@ -1,7 +1,10 @@ +import { Model, model } from 'mongoose' import { CreateUserDto } from '../types/CreateUserDto' import { IUser } from '../types/IUser' import { UserDto } from '../types/UserDto' -import userModel from './user.model' +import userSchema from './user.model' + +const userModel: Model = model('User', userSchema) export async function findAllUsers(): Promise { return userModel.find()