Skip to content

Commit

Permalink
Fixed error the trying to delete
Browse files Browse the repository at this point in the history
  • Loading branch information
maubarraganwize committed Oct 26, 2023
1 parent f342ee8 commit 436f93f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/profile.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export async function updateProfile(
export async function updateGithubUser(userProfile: UserProfile, githubUser: string = '') {
if (userProfile.githubUser === githubUser) return null
const { data: userInfo } = await getUserByUsername(githubUser)
if (githubUser.length > 0 || userInfo) {
if (githubUser.length > 0 && userInfo) {
const githubProfile = await getGitHubProfileByEmail(userProfile.email);
const { data: repos } = await getUserRepos(userInfo.login);
if (githubProfile) {
Expand Down Expand Up @@ -149,7 +149,7 @@ export async function updateGithubUser(userProfile: UserProfile, githubUser: str
}
}
else {
await prisma.gitHubProfile.delete({ where: { email: userProfile.email } })
await prisma.gitHubProfile.deleteMany({ where: { email: userProfile.email } })
await prisma.gitHubProjects.deleteMany({
where: { owner_email: userProfile.email }
})
Expand Down

0 comments on commit 436f93f

Please sign in to comment.