feat: implement admin blocks management feature
- Added AdminBlocksManagement component for managing court blocks. - Implemented functionality to create, edit, and delete blocks. - Integrated fetching of courts and blocks from the API. - Added validation for block creation and editing forms. - Enhanced UI with responsive design for mobile and desktop views. - Created database migration for court_blocks table and updated users table with theme_preference.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
CREATE TABLE `court_blocks` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`court_id` text,
|
||||
`date` text NOT NULL,
|
||||
`start_time` text NOT NULL,
|
||||
`end_time` text NOT NULL,
|
||||
`reason` text NOT NULL,
|
||||
`created_by` text NOT NULL,
|
||||
`created_at` integer NOT NULL,
|
||||
FOREIGN KEY (`court_id`) REFERENCES `courts`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE users ADD `theme_preference` text DEFAULT 'system' NOT NULL;
|
||||
Reference in New Issue
Block a user