fixed permission_reposity queries
This commit is contained in:
@@ -100,7 +100,7 @@ func GetUserAttributes(userID string) (map[string]string, error) {
|
||||
func GetUserByID(userID string) (*models.User, error) {
|
||||
query := `
|
||||
SELECT user_id, first_name, middle_initial, last_name, suffix, email_address,
|
||||
emp_id, reg, prov, aProv, mun, bgy, is_logged_in,
|
||||
emp_id, is_logged_in,
|
||||
first_logged_in, home_address, contact_number, device_id, role_id, is_deleted, secret_key, is_activated, created_at, updated_at
|
||||
FROM uess_user_management.users
|
||||
WHERE user_id = ? AND is_deleted = 'N'
|
||||
@@ -116,18 +116,12 @@ func GetUserByID(userID string) (*models.User, error) {
|
||||
&user.Suffix,
|
||||
&user.EmailAddress,
|
||||
&user.EmpID,
|
||||
&user.Reg,
|
||||
&user.Prov,
|
||||
&user.AProv,
|
||||
&user.Mun,
|
||||
&user.Bgy,
|
||||
&user.IsLoggedIn,
|
||||
&user.FirstLoggedIn,
|
||||
&user.HomeAddress,
|
||||
&user.ContactNumber,
|
||||
&user.DeviceID,
|
||||
&user.RoleID,
|
||||
&user.RoleDPS,
|
||||
&user.IsDeleted,
|
||||
&user.SecretKey,
|
||||
&user.IsActivated,
|
||||
|
||||
@@ -109,9 +109,8 @@ func TestGetUserByIDSuccess(t *testing.T) {
|
||||
|
||||
rows := sqlmock.NewRows([]string{
|
||||
"user_id", "first_name", "middle_initial", "last_name", "suffix", "email_address",
|
||||
"account_type", "emp_id", "reg", "prov", "aProv", "mun", "bgy", "is_logged_in",
|
||||
"first_logged_in", "address", "contact_number", "device_id", "role_id",
|
||||
"role_dps", "is_deleted", "secret_key", "is_activated", "created_at", "updated_at",
|
||||
"emp_id", "reg", "prov", "aProv", "mun", "bgy", "is_logged_in",
|
||||
"first_logged_in", "address", "contact_number", "device_id", "role_id", "is_deleted", "secret_key", "is_activated", "created_at", "updated_at",
|
||||
}).AddRow(
|
||||
"user123", "John", "M", "Doe", "Jr", "john@example.com",
|
||||
"regular", "EMP001", "01", "02", "03", "04", "05", "Y",
|
||||
@@ -319,7 +318,7 @@ func TestGetUserByIDEmptyID(t *testing.T) {
|
||||
"user_id", "first_name", "middle_initial", "last_name", "suffix", "email_address",
|
||||
"account_type", "emp_id", "reg", "prov", "aProv", "mun", "bgy", "is_logged_in",
|
||||
"first_logged_in", "address", "contact_number", "device_id", "role_id",
|
||||
"role_dps", "is_deleted", "secret_key", "is_activated", "created_at", "updated_at",
|
||||
"is_deleted", "secret_key", "is_activated", "created_at", "updated_at",
|
||||
})
|
||||
|
||||
// Match the actual query format with all the fields
|
||||
|
||||
Reference in New Issue
Block a user