@@ -33,20 +33,12 @@ export async function startMockServer() {
3333 customHandlers : [
3434 // Custom handlers that are not part of standard CRUD
3535 http . get ( '/api/bootstrap' , async ( ) => {
36- // We can use ObjectStackServer helper which proxies to the kernel if initialized
37- // Or better, use the kernel instance we have right here.
38- // But MSWPlugin might not expose the kernel globally to the handler context easily without closure
39- // So we use the closure 'kernel' variable.
40-
41- // However, ObjectQL usually requires a 'session'.
42- const session = { userId : 'current' , isSpaceAdmin : true } ; // Mock session
43-
36+ // We use closure 'driver' variable to bypass objectql service issues
4437 try {
45- const objectql = kernel ! . getService < any > ( 'objectql' ) ;
46- // Use IDataEngine interface directly
47- const user = ( await objectql . findOne ( 'user' , 'current' ) ) || { } ;
48- const contacts = await objectql . find ( 'contact' , { } ) ;
49- const opportunities = await objectql . find ( 'opportunity' , { } ) ;
38+ // Use IDataEngine interface directly via driver
39+ const user = ( await driver . findOne ( 'user' , 'current' ) ) || { } ;
40+ const contacts = await driver . find ( 'contact' , { } ) ;
41+ const opportunities = await driver . find ( 'opportunity' , { } ) ;
5042 const stats = { revenue : 125000 , leads : 45 , deals : 12 } ;
5143
5244 return HttpResponse . json ( {
@@ -74,7 +66,6 @@ export async function startMockServer() {
7466// Helper to seed data into the in-memory driver
7567async function initializeMockData ( kernel : ObjectKernel , driver : InMemoryDriver ) {
7668 console . log ( '[MockServer] Initializing mock data (fresh)...' ) ;
77- // const objectql = kernel.getService<any>('objectql');
7869
7970 try {
8071 // Seed User
0 commit comments