forked from Yara724/api
Initial commit after migration to gitea
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { InjectModel } from "@nestjs/mongoose";
|
||||
import { Model, Types } from "mongoose";
|
||||
import { UserSignModel } from "../schema/sign.schema";
|
||||
|
||||
export class UserSignDbService {
|
||||
constructor(
|
||||
@InjectModel(UserSignModel.name)
|
||||
private readonly blameVoiceModel: Model<UserSignModel>,
|
||||
) {}
|
||||
|
||||
async create(sign: UserSignModel): Promise<UserSignModel> {
|
||||
return await this.blameVoiceModel.create(sign);
|
||||
}
|
||||
|
||||
async findOne(id: string): Promise<UserSignModel> {
|
||||
return await this.blameVoiceModel.findOne(new Types.ObjectId(id));
|
||||
}
|
||||
|
||||
async findById(id: string): Promise<UserSignModel | null> {
|
||||
// Use your correct Model type
|
||||
return this.blameVoiceModel.findById(id).lean();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user