errsole-sequelize
Advanced tools
Comparing version 0.0.1 to 1.0.0
@@ -194,3 +194,3 @@ const { Sequelize, DataTypes } = require('sequelize'); | ||
async updateUserprofile (email, updates) { | ||
async updateUserProfile (email, updates) { | ||
if (!email) { | ||
@@ -204,10 +204,15 @@ return { status: false, error: 'Email is required' }; | ||
delete updates.id; | ||
try { | ||
const [updatedCount] = await this.errsoleUsers.update(updates, { where: { email } }); | ||
if (updatedCount === 0) { | ||
return { status: false, error: 'User not found or no updates applied' }; | ||
const user = await this.errsoleUsers.findOne({ where: { email } }); | ||
if (!user) { | ||
return { status: false, error: 'User not found' }; | ||
} | ||
const [updateCount] = await this.errsoleUsers.update(updates, { | ||
where: { email } | ||
}); | ||
if (updateCount === 0) { | ||
return { status: false, error: 'User update failed' }; | ||
} | ||
return { status: true, message: 'User profile updated successfully' }; | ||
return { status: true, message: 'User updated successfully' }; | ||
} catch (error) { | ||
@@ -214,0 +219,0 @@ return { status: false, error: error.message }; |
{ | ||
"name": "errsole-sequelize", | ||
"version": "0.0.1", | ||
"version": "1.0.0", | ||
"description": "A Sequelize logging module for Node.js applications that automatically captures all logs.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10381
235
2