V1 for the builder processing

This commit is contained in:
2025-05-27 12:19:15 +05:30
parent 9b4f8c0841
commit 7603c1b64a
27 changed files with 836 additions and 261 deletions

View File

@@ -18,9 +18,9 @@ export const TrashDatas = async (data: IOrg) => {
try {
const { organization, role, userId } = data;
let filter = { isArchive: true, isDeleted: false } as RoleFilter;
if (role === "User") {
filter.createdBy = userId;
}
// if (role === "User") {
// filter.createdBy = userId;
// }
const TrashLists = await projectModel(organization).find(filter);
if (!TrashLists) return { staus: "Trash is Empty" };
const TrashDocs: any[] = [];
@@ -57,9 +57,9 @@ export const RestoreTrashData = async (data: IRestore) => {
try {
const { projectId, organization, role, userId } = data;
let filter = { isArchive: true, _id: projectId } as RoleFilter;
if (role === "User") {
filter.createdBy = userId;
}
// if (role === "User") {
// filter.createdBy = userId;
// }
const findProject = await projectModel(organization).findOne(filter);
if (!findProject) return { status: "Project not found" };
const restoreData = await projectModel(organization).findOneAndUpdate(