@amohamud23/notihub 1.1.20 → 1.1.22

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/index.cjs CHANGED
@@ -267,9 +267,11 @@ var User = class _User {
267
267
  * @returns A promise that resolves to the updated user object.
268
268
  */
269
269
  static async updateUser(id, user) {
270
- const updateFields = Object.keys(user);
270
+ const updateFields = Object.keys(user).filter(
271
+ (key) => key !== "id" && user[key] !== void 0
272
+ );
271
273
  if (updateFields.length === 0) {
272
- throw new Error("No fields provided to update.");
274
+ throw new Error("No valid fields provided to update.");
273
275
  }
274
276
  const UpdateExpression = `SET ${updateFields.map((field, idx) => `#field${idx} = :value${idx}`).join(", ")}`;
275
277
  const ExpressionAttributeNames = updateFields.reduce((acc, field, idx) => {
package/dist/index.js CHANGED
@@ -234,9 +234,11 @@ var User = class _User {
234
234
  * @returns A promise that resolves to the updated user object.
235
235
  */
236
236
  static async updateUser(id, user) {
237
- const updateFields = Object.keys(user);
237
+ const updateFields = Object.keys(user).filter(
238
+ (key) => key !== "id" && user[key] !== void 0
239
+ );
238
240
  if (updateFields.length === 0) {
239
- throw new Error("No fields provided to update.");
241
+ throw new Error("No valid fields provided to update.");
240
242
  }
241
243
  const UpdateExpression = `SET ${updateFields.map((field, idx) => `#field${idx} = :value${idx}`).join(", ")}`;
242
244
  const ExpressionAttributeNames = updateFields.reduce((acc, field, idx) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amohamud23/notihub",
3
- "version": "1.1.20",
3
+ "version": "1.1.22",
4
4
  "description": "Notihub Package",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.cts",