Skip to content

Commit

Permalink
hotfix: fix user serivce<
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloose committed Oct 28, 2023
1 parent 2025364 commit 926c2d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DATABASE_URL="ask your team for the database url"
JWT_SECRET="yoursecrettoken"
18 changes: 2 additions & 16 deletions src/services/users.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class UsersService {
return { user: null, error: result.error.errors[0].message, status: 400 };
}

const { email, names, surnames, password, roles } = result.data;
const { email, names, surnames, password } = result.data;
const hashed_password = this.hashPassword(password);

try {
Expand All @@ -30,15 +30,6 @@ export class UsersService {
surnames,
hashed_password,
email,
roles: {
create: roles.map((roleName) => ({
role: {
create: {
name: roleName,
},
},
})),
},
},
});
return { user, error: null, status: 201 };
Expand All @@ -63,12 +54,7 @@ export class UsersService {
include: {
roles: {
select: {
userId: true,
role: {
select: {
name: true,
},
},
name: true,
},
},
},
Expand Down

0 comments on commit 926c2d8

Please sign in to comment.