Compare commits
3 Commits
f7f5ac7e3b
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| ba9f74afd5 | |||
| 7528b36c48 | |||
| 84571c3516 |
@@ -8,7 +8,13 @@
|
||||
"mcp__Claude_Preview__preview_start",
|
||||
"Bash(curl -s http://localhost:8080/api/v1/users -H \"Authorization: Bearer test\")",
|
||||
"Bash(curl -s -X POST http://localhost:8080/api/v1/auth/login -H \"Content-Type: application/json\" -d \"{\"\"email\"\":\"\"admin@demo.com\"\",\"\"password\"\":\"\"password123\"\"}\")",
|
||||
"Bash(curl -s \"http://localhost:8080/api/v1/users\" -H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjbW16c3JsdXowMDA0dTVqM2JldWwyMnM3IiwidmVuZG9ySWQiOiJkZW1vLXZlbmRvciIsInJvbGVJZCI6ImNtbXpzcmx0ZDAwMDB1NWozdnV6Y2QzZW0iLCJyb2xlTmFtZSI6Im93bmVyIiwiaWF0IjoxNzc0MDY2MjU4LCJleHAiOjE3NzQwNjcxNTh9.eBSLkZVXafSBE-o6A2I626EgBcxxXSKGVu7pv3yQdhU\")"
|
||||
"Bash(curl -s \"http://localhost:8080/api/v1/users\" -H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjbW16c3JsdXowMDA0dTVqM2JldWwyMnM3IiwidmVuZG9ySWQiOiJkZW1vLXZlbmRvciIsInJvbGVJZCI6ImNtbXpzcmx0ZDAwMDB1NWozdnV6Y2QzZW0iLCJyb2xlTmFtZSI6Im93bmVyIiwiaWF0IjoxNzc0MDY2MjU4LCJleHAiOjE3NzQwNjcxNTh9.eBSLkZVXafSBE-o6A2I626EgBcxxXSKGVu7pv3yQdhU\")",
|
||||
"Bash(DATABASE_URL=\"file:./prisma/dev.db\" npx prisma migrate dev --name add_events_rename_roles)",
|
||||
"Bash(DATABASE_URL=\"file:./prisma/dev.db\" npx tsx prisma/seed.ts)",
|
||||
"Bash(git add:*)",
|
||||
"Bash(git commit:*)",
|
||||
"Bash(npx tsc:*)",
|
||||
"Bash(curl -s http://localhost:8080/api/v1/health)"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ export function Btn({
|
||||
children,
|
||||
variant = "primary",
|
||||
type = "button",
|
||||
size,
|
||||
disabled,
|
||||
onClick,
|
||||
style,
|
||||
@@ -40,6 +41,7 @@ export function Btn({
|
||||
children: React.ReactNode;
|
||||
variant?: "primary" | "danger" | "ghost";
|
||||
type?: "button" | "submit" | "reset";
|
||||
size?: "sm";
|
||||
disabled?: boolean;
|
||||
onClick?: () => void;
|
||||
style?: React.CSSProperties;
|
||||
@@ -47,9 +49,9 @@ export function Btn({
|
||||
const base: React.CSSProperties = {
|
||||
border: "none",
|
||||
borderRadius: "var(--radius)",
|
||||
padding: "8px 16px",
|
||||
padding: size === "sm" ? "4px 10px" : "8px 16px",
|
||||
fontWeight: 600,
|
||||
fontSize: 13,
|
||||
fontSize: size === "sm" ? 12 : 13,
|
||||
cursor: disabled ? "not-allowed" : "pointer",
|
||||
opacity: disabled ? 0.6 : 1,
|
||||
};
|
||||
|
||||
@@ -301,7 +301,7 @@ function emptyProduct() {
|
||||
return { name: "", sku: "", price: "", categoryId: "", taxId: "", description: "" };
|
||||
}
|
||||
|
||||
function f(key: string, set: React.Dispatch<React.SetStateAction<Record<string, string>>>) {
|
||||
function f<T extends Record<string, string>>(key: keyof T, set: React.Dispatch<React.SetStateAction<T>>) {
|
||||
return (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) =>
|
||||
set((prev) => ({ ...prev, [key]: e.target.value }));
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ export default function UsersPage() {
|
||||
|
||||
const openEdit = (user: User) => {
|
||||
setSelected(user);
|
||||
setForm({ name: user.name, email: user.email, password: "", roleId: user.role.id });
|
||||
setForm({ name: user.name, email: user.email, password: "", roleId: user.role.id, vendorId: user.vendor?.id ?? "" });
|
||||
setError("");
|
||||
setModal("edit");
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
PORT=8080
|
||||
NODE_ENV=development
|
||||
DATABASE_URL=file:./dev.db
|
||||
DATABASE_URL=file:./prisma/dev.db
|
||||
JWT_SECRET=change-me-in-production
|
||||
LOG_LEVEL=info
|
||||
CORS_ORIGIN=http://localhost:5173
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import express from "express";
|
||||
import cors from "cors";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import healthRouter from "./routes/health.js";
|
||||
import authRouter from "./routes/auth.js";
|
||||
import vendorsRouter from "./routes/vendors.js";
|
||||
@@ -15,9 +14,6 @@ import eventsRouter from "./routes/events.js";
|
||||
import { errorHandler } from "./middleware/errorHandler.js";
|
||||
import { requestLogger } from "./middleware/requestLogger.js";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
export function createApp() {
|
||||
const app = express();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user