Fix 404 for invalid email of actors, added APIs for client settings

This commit is contained in:
SepehrYahyaee
2026-05-16 15:47:31 +03:30
parent 7c76149c95
commit 7797a4ddab
8 changed files with 484 additions and 47 deletions

View File

@@ -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();
}
}