fix : create category
Build and Deploy / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-02-21 09:48:21 +03:30
parent 703546bfef
commit 3d1d4d7ef7
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ class CategoryRepository extends BaseRepository<ICategory> {
super(CategoryModel); super(CategoryModel);
} }
async findByTitle(title_en: string, id?: string) { async findByTitle(title_en: string, id?: string) {
const query: Record<string, any> = { title_en }; const query: Record<string, any> = { title_en, deleted: false };
if (id) { if (id) {
query._id = { $ne: id }; query._id = { $ne: id };
@@ -5,7 +5,7 @@ import { ICategory } from "./Abstraction/ICategory";
const categorySchema = new Schema<ICategory>( const categorySchema = new Schema<ICategory>(
{ {
title_fa: { type: String, required: true }, title_fa: { type: String, required: true },
title_en: { type: String, unique: true, required: true }, title_en: { type: String, false: true, required: true },
icon: { type: String, default: "/images/icons/default.png" }, icon: { type: String, default: "/images/icons/default.png" },
imageUrl: { type: String, required: true }, imageUrl: { type: String, required: true },
description: { type: String, required: true }, description: { type: String, required: true },