chore: fix problem of transcation beeing commited throw update the "
category variant
This commit is contained in:
@@ -72,10 +72,8 @@ export class LearningService {
|
||||
}
|
||||
|
||||
async update(learningId: string, updateDto: UpdateLearningDTO) {
|
||||
console.log(learningId);
|
||||
if (!isValidObjectId(learningId)) throw new BadRequestError(CommonMessage.NotValidId);
|
||||
const learning = await this.learningRepo.model.findByIdAndUpdate(learningId, updateDto, { new: true });
|
||||
console.log(learning);
|
||||
if (!learning) throw new BadRequestError(CommonMessage.NotFoundById);
|
||||
return {
|
||||
message: CommonMessage.Updated,
|
||||
@@ -86,7 +84,6 @@ export class LearningService {
|
||||
async updateCategory(catId: string, updateDto: UpdateLearningCategoryDTO) {
|
||||
if (!isValidObjectId(catId)) throw new BadRequestError(CommonMessage.NotValidId);
|
||||
const learningCategory = await this.learningCategoryRepo.model.findByIdAndUpdate(catId, updateDto, { new: true });
|
||||
console.log(learningCategory);
|
||||
if (!learningCategory) throw new BadRequestError(CommonMessage.NotFoundById);
|
||||
return {
|
||||
message: CommonMessage.Updated,
|
||||
@@ -128,13 +125,11 @@ export class LearningService {
|
||||
|
||||
async getLearningProgressBySellerForAdmin() {
|
||||
const progress = await this.learningProgressRepo.getLearningProgressBySellers();
|
||||
console.log(progress);
|
||||
return { progress };
|
||||
}
|
||||
|
||||
async getLearningProgressWatched(sellerId: string, catId: string) {
|
||||
const progress = await this.learningRepo.getVideosWithWatchStatus(sellerId, catId);
|
||||
console.log(progress);
|
||||
return { progress };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user