merged with main branch to clear the testing commits
This commit is contained in:
@@ -36,12 +36,8 @@ export const RecentlyAdded = async (data: IRecentData) => {
|
||||
model: projectModel(organization),
|
||||
select: "_id",
|
||||
});
|
||||
let filter = { isArchive: false } as RoleFilter;
|
||||
// if (role === "User") {
|
||||
// filter.createdBy = userId;
|
||||
// }
|
||||
|
||||
const populatedProjects = userRecentData.recentlyViewed as IProject[];
|
||||
console.log("populatedProjects: ", populatedProjects);
|
||||
const RecentDatas = await Promise.all(
|
||||
populatedProjects.map(async (project) => {
|
||||
const projectExisting = await projectModel(organization)
|
||||
@@ -50,7 +46,6 @@ export const RecentlyAdded = async (data: IRecentData) => {
|
||||
return projectExisting;
|
||||
})
|
||||
);
|
||||
console.log("RecentDatas: ", RecentDatas);
|
||||
|
||||
const filteredProjects = RecentDatas.filter(Boolean);
|
||||
console.log("filteredProjects: ", filteredProjects);
|
||||
@@ -65,7 +60,7 @@ export const searchProject = async (data: searchProjectInterface) => {
|
||||
const userExisting = await existingUser(userId, organization);
|
||||
if (!userExisting) return { status: "User not found" };
|
||||
const findprojectName = await projectModel(organization).find({
|
||||
projectName: { $regex: `${searchName}`, $options: "i" }, // 'i' makes it case-insensitive
|
||||
projectName: { $regex: `${searchName}`, $options: "i" },
|
||||
isArchive: false,
|
||||
});
|
||||
if (!findprojectName || findprojectName.length === 0)
|
||||
|
||||
Reference in New Issue
Block a user