my-typescript-library-rahul52us 2.5.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/repository/document.repository.js +8 -6
- package/dist/repository/document.repository.js.map +1 -1
- package/dist/services/document/document.services.js +1 -1
- package/dist/services/document/document.services.js.map +1 -1
- package/dist/types/repository/document.repository.d.ts +5 -1
- package/package.json +1 -1
- package/sequelstring-customer-nexus-main/package-lock.json +7471 -0
- package/src/repository/document.repository.ts +15 -8
- package/src/services/document/document.services.ts +1 -0
|
@@ -2111,18 +2111,25 @@ export async function updateComment(id: string, data: Partial<IDocument>) : Prom
|
|
|
2111
2111
|
}
|
|
2112
2112
|
}
|
|
2113
2113
|
|
|
2114
|
-
|
|
2114
|
+
|
|
2115
|
+
export async function updateStatus(
|
|
2116
|
+
data: { documentId: string; key?: string; value: any }
|
|
2117
|
+
): Promise<any> {
|
|
2115
2118
|
try {
|
|
2119
|
+
const { documentId, key = "status", value } = data;
|
|
2120
|
+
if (!documentId) return null;
|
|
2121
|
+
const updatePayload = {
|
|
2122
|
+
[`originalValues.${key}`]: value,
|
|
2123
|
+
};
|
|
2124
|
+
|
|
2116
2125
|
const result = await Document.updateOne(
|
|
2117
|
-
{ documentId
|
|
2118
|
-
{ $set:
|
|
2126
|
+
{ documentId },
|
|
2127
|
+
{ $set: updatePayload }
|
|
2119
2128
|
);
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
} else {
|
|
2123
|
-
return result;
|
|
2124
|
-
}
|
|
2129
|
+
|
|
2130
|
+
return result.matchedCount === 0 ? null : result;
|
|
2125
2131
|
} catch (err) {
|
|
2132
|
+
console.error("Update failed:", err);
|
|
2126
2133
|
return null;
|
|
2127
2134
|
}
|
|
2128
2135
|
}
|