forked from Yara724/api
Fix 404 for invalid email of actors, added APIs for client settings
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from "@nestjs/common";
|
||||
import { InjectModel } from "@nestjs/mongoose";
|
||||
import { FilterQuery, Model } from "mongoose";
|
||||
import { FilterQuery, Model, UpdateQuery } from "mongoose";
|
||||
import { ClientModel, ClientDocument } from "../schema/client.schema";
|
||||
|
||||
@Injectable()
|
||||
@@ -25,4 +25,14 @@ export class ClientDbService {
|
||||
async findAll(): Promise<ClientModel[]> {
|
||||
return await this.clientModel.find();
|
||||
}
|
||||
|
||||
async findByIdAndUpdate(
|
||||
id: string,
|
||||
update: UpdateQuery<ClientModel>,
|
||||
): Promise<ClientModel | null> {
|
||||
return this.clientModel
|
||||
.findByIdAndUpdate(id, update, { new: true })
|
||||
.lean()
|
||||
.exec();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user