File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -177,9 +177,11 @@ async function addWorkBooks() {
177177 id : workbook . authorId ,
178178 } ,
179179 } ) ;
180+ // Allow undefined to match empty strings
181+ const normalizedUrlSlug = workbook . urlSlug || undefined ;
180182 const registeredWorkBook = await prisma . workBook . findMany ( {
181183 where : {
182- urlSlug : workbook . urlSlug ,
184+ urlSlug : normalizedUrlSlug ,
183185 } ,
184186 } ) ;
185187
Original file line number Diff line number Diff line change 1- import { WorkBookType , type WorkBook , type WorkBookTasksBase } from '../src/lib/types/workbook' ;
1+ import { WorkBookType , type WorkBook } from '../src/lib/types/workbook' ;
22
33function createWorkBookBase ( overrides : Partial < WorkBook > = { } ) : WorkBook {
44 return {
@@ -11,16 +11,12 @@ function createWorkBookBase(overrides: Partial<WorkBook> = {}): WorkBook {
1111 isOfficial : false ,
1212 isReplenished : false ,
1313 workBookType : WorkBookType . CREATED_BY_USER ,
14- urlSlug : '' ,
15- workBookTasks : createWorkBookTasks ( ) ,
14+ urlSlug : '' , // Only include urlSlug when it's explicitly provided
15+ workBookTasks : [ ] ,
1616 ...overrides ,
1717 } ;
1818}
1919
20- function createWorkBookTasks ( ) : WorkBookTasksBase {
21- return [ { taskId : 'abc322_d' , priority : 1 , comment : '' } ] ;
22- }
23-
2420export const workbooks = [
2521 createWorkBookBase ( {
2622 title : '標準入出力(1 個の整数)' ,
You can’t perform that action at this time.
0 commit comments