UPDATE: Fix bug
All checks were successful
Build and Release / release (push) Successful in 1m27s

This commit is contained in:
2026-04-10 15:52:09 +07:00
parent 0896fd587e
commit af76d2a26a
22 changed files with 586 additions and 129 deletions

View File

@@ -70,16 +70,21 @@ func SeedSuperAdmin(pool *pgxpool.Pool) error {
return err
}
role, err := q.GetRoleByName(ctx, constants.ADMIN.String())
adminRole, err := q.GetRoleByName(ctx, constants.ADMIN.String())
if err != nil {
return err
}
err = q.AddUserRole(
useRole, err := q.GetRoleByName(ctx, constants.USER.String())
if err != nil {
return err
}
err = q.CreateUserRole(
ctx,
sqlc.AddUserRoleParams{
sqlc.CreateUserRoleParams{
UserID: user.ID,
Column2: []pgtype.UUID{role.ID},
Column2: []pgtype.UUID{adminRole.ID, useRole.ID},
},
)
if err != nil {