feat: dashboard interface
This commit is contained in:
@@ -4,7 +4,7 @@ import { eq } from "drizzle-orm";
|
||||
import { z } from "zod";
|
||||
|
||||
const paramsSchema = z.object({
|
||||
id: z.number(),
|
||||
id: z.string().transform(Number),
|
||||
});
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
@@ -4,7 +4,7 @@ import { eq } from "drizzle-orm";
|
||||
import { z } from "zod";
|
||||
|
||||
const paramsSchema = z.object({
|
||||
id: z.number(),
|
||||
id: z.string().transform(Number),
|
||||
});
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
@@ -4,7 +4,7 @@ import { eq } from "drizzle-orm";
|
||||
import { z } from "zod";
|
||||
|
||||
const paramsSchema = z.object({
|
||||
id: z.number(),
|
||||
id: z.string().transform(Number),
|
||||
});
|
||||
|
||||
const bodySchema = z.object({
|
||||
@@ -5,7 +5,8 @@ import { z } from "zod";
|
||||
const bodySchema = z.object({
|
||||
name: z.string().min(1),
|
||||
path: z.string().min(1),
|
||||
url: z.url().min(1),
|
||||
url: z.url(),
|
||||
disabled: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
|
||||
1
server/db/migrations/0001_tense_grey_gargoyle.sql
Normal file
1
server/db/migrations/0001_tense_grey_gargoyle.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `links` ADD `disabled` integer DEFAULT false NOT NULL;
|
||||
86
server/db/migrations/meta/0001_snapshot.json
Normal file
86
server/db/migrations/meta/0001_snapshot.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"version": "6",
|
||||
"dialect": "sqlite",
|
||||
"id": "0e8befef-3e4f-43f1-a031-95c2ca514e30",
|
||||
"prevId": "d03860ad-0d5c-4943-92ba-d704c74e1501",
|
||||
"tables": {
|
||||
"links": {
|
||||
"name": "links",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"path": {
|
||||
"name": "path",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"url": {
|
||||
"name": "url",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"disabled": {
|
||||
"name": "disabled",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"links_name_unique": {
|
||||
"name": "links_name_unique",
|
||||
"columns": [
|
||||
"name"
|
||||
],
|
||||
"isUnique": true
|
||||
},
|
||||
"links_path_unique": {
|
||||
"name": "links_path_unique",
|
||||
"columns": [
|
||||
"path"
|
||||
],
|
||||
"isUnique": true
|
||||
},
|
||||
"links_url_unique": {
|
||||
"name": "links_url_unique",
|
||||
"columns": [
|
||||
"url"
|
||||
],
|
||||
"isUnique": true
|
||||
}
|
||||
},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
}
|
||||
},
|
||||
"views": {},
|
||||
"enums": {},
|
||||
"_meta": {
|
||||
"schemas": {},
|
||||
"tables": {},
|
||||
"columns": {}
|
||||
},
|
||||
"internal": {
|
||||
"indexes": {}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,13 @@
|
||||
"when": 1773788954273,
|
||||
"tag": "0000_pretty_mentor",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 1,
|
||||
"version": "6",
|
||||
"when": 1773792538248,
|
||||
"tag": "0001_tense_grey_gargoyle",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -5,4 +5,5 @@ export const links = sqliteTable("links", {
|
||||
name: text("name").notNull().unique(),
|
||||
path: text("path").notNull().unique(),
|
||||
url: text("url").notNull().unique(),
|
||||
disabled: integer("disabled", { mode: "boolean" }).notNull().default(false),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user