Update package dependencies, enhance README for clarity, and implement new features in the admin panel and script detail pages. Added support for collections, improved script submission previews, and refactored comment handling in the script detail view.
This commit is contained in:
23
src/lib/api/index.ts
Normal file
23
src/lib/api/index.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { db } from '@/lib/db';
|
||||
import { scripts, users, ratings, scriptVersions, scriptAnalytics, scriptCollections, collectionScripts } from '@/lib/db/schema';
|
||||
import { eq, desc, asc, and, or, like, count, sql } from 'drizzle-orm';
|
||||
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