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:
20
temp_api_backup/api/index.ts
Normal file
20
temp_api_backup/api/index.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
// Generate unique IDs
|
||||
export const generateId = () => nanoid();
|
||||
|
||||
// Error handling
|
||||
export class ApiError extends Error {
|
||||
constructor(message: string, public status: number = 500) {
|
||||
super(message);
|
||||
this.name = 'ApiError';
|
||||
}
|
||||
}
|
||||
|
||||
// Export all service modules
|
||||
export * from './scripts';
|
||||
export * from './users';
|
||||
export * from './ratings';
|
||||
export * from './analytics';
|
||||
export * from './collections';
|
||||
export * from './auth';
|
Reference in New Issue
Block a user