Skip to content

Commit

Permalink
Resolution for issue hagopj13#281
Browse files Browse the repository at this point in the history
  • Loading branch information
JellyPies committed Dec 27, 2023
1 parent 179ae84 commit 2873bb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/services/auth.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const logout = async (refreshToken) => {
if (!refreshTokenDoc) {
throw new ApiError(httpStatus.NOT_FOUND, 'Not found');
}
await refreshTokenDoc.remove();
await refreshTokenDoc.deleteOne();
};

/**
Expand All @@ -44,7 +44,7 @@ const refreshAuth = async (refreshToken) => {
if (!user) {
throw new Error();
}
await refreshTokenDoc.remove();
await refreshTokenDoc.deleteOne();
return tokenService.generateAuthTokens(user);
} catch (error) {
throw new ApiError(httpStatus.UNAUTHORIZED, 'Please authenticate');
Expand Down
2 changes: 1 addition & 1 deletion src/services/user.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const deleteUserById = async (userId) => {
if (!user) {
throw new ApiError(httpStatus.NOT_FOUND, 'User not found');
}
await user.remove();
await user.deleteOne();
return user;
};

Expand Down

0 comments on commit 2873bb0

Please sign in to comment.