Skip to content

Commit 69c24d0

Browse files
committed
♻️ Refactoring (#1124)
1 parent bbdf75f commit 69c24d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

prisma/seed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ async function addWorkBooks() {
172172

173173
if (normalizedUrlSlug) {
174174
// If urlSlug exists, check by urlSlug
175-
registeredWorkBook = await prisma.workBook.findFirst({
175+
registeredWorkBook = await prisma.workBook.findUnique({
176176
where: {
177177
urlSlug: normalizedUrlSlug,
178178
},
@@ -249,7 +249,7 @@ async function addWorkBook(workbook, workBookFactory) {
249249
* ```
250250
*/
251251
function normalizeUrlSlug(urlSlug: string | null | undefined): string | undefined {
252-
return urlSlug && urlSlug !== '' ? urlSlug.toLowerCase() : undefined;
252+
return urlSlug && urlSlug.trim() !== '' ? urlSlug.trim().toLowerCase() : undefined;
253253
}
254254

255255
async function addTags() {

0 commit comments

Comments
 (0)