Refactor API files to provide mock implementations for analytics, auth, collections, ratings, scripts, and users, streamlining the codebase for frontend-only functionality. Remove legacy database schema and browser compatibility files to enhance clarity and maintainability.
This commit is contained in:
33
temp_api_backup/db/browser.ts
Normal file
33
temp_api_backup/db/browser.ts
Normal file
@ -0,0 +1,33 @@
|
||||
// Browser-compatible database interface
|
||||
// This provides mock implementations for browser builds
|
||||
|
||||
export const db = {
|
||||
query: {
|
||||
users: {
|
||||
findFirst: () => Promise.resolve(null),
|
||||
findMany: () => Promise.resolve([]),
|
||||
},
|
||||
scripts: {
|
||||
findFirst: () => Promise.resolve(null),
|
||||
findMany: () => Promise.resolve([]),
|
||||
},
|
||||
},
|
||||
select: () => ({ from: () => ({ where: () => Promise.resolve([]) }) }),
|
||||
insert: () => ({ values: () => Promise.resolve() }),
|
||||
update: () => ({ set: () => ({ where: () => Promise.resolve() }) }),
|
||||
delete: () => ({ where: () => Promise.resolve() }),
|
||||
};
|
||||
|
||||
// Export schema as empty objects for browser compatibility
|
||||
export const users = {};
|
||||
export const scripts = {};
|
||||
export const ratings = {};
|
||||
export const scriptVersions = {};
|
||||
export const scriptAnalytics = {};
|
||||
export const scriptCollections = {};
|
||||
export const collectionScripts = {};
|
||||
|
||||
// Export empty relations
|
||||
export const usersRelations = {};
|
||||
export const scriptsRelations = {};
|
||||
export const ratingsRelations = {};
|
Reference in New Issue
Block a user