This commit is contained in:
Kurt Hutten
2021-10-13 20:22:49 +11:00
parent 68fa10437e
commit 3df903ffc6
3 changed files with 13 additions and 11 deletions

View File

@@ -47,15 +47,17 @@ export const projectByUserAndTitle = async ({ userName, projectTitle }) => {
},
})
}
const isUniqueProjectTitle = (userId: string) => async (seed: string) =>
db.project.findUnique({
where: {
title_userId: {
title: seed,
userId,
const isUniqueProjectTitle =
(userId: string) =>
async (seed: string): Promise<boolean> =>
!!(await db.project.findUnique({
where: {
title_userId: {
title: seed,
userId,
},
},
},
})
}))
interface CreateProjectArgs {
input: Prisma.ProjectCreateArgs['data']