Compare commits
3 Commits
f7f5ac7e3b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| ba9f74afd5 | |||
| 7528b36c48 | |||
| 84571c3516 |
@@ -8,7 +8,13 @@
|
|||||||
"mcp__Claude_Preview__preview_start",
|
"mcp__Claude_Preview__preview_start",
|
||||||
"Bash(curl -s http://localhost:8080/api/v1/users -H \"Authorization: Bearer test\")",
|
"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 -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,
|
children,
|
||||||
variant = "primary",
|
variant = "primary",
|
||||||
type = "button",
|
type = "button",
|
||||||
|
size,
|
||||||
disabled,
|
disabled,
|
||||||
onClick,
|
onClick,
|
||||||
style,
|
style,
|
||||||
@@ -40,6 +41,7 @@ export function Btn({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
variant?: "primary" | "danger" | "ghost";
|
variant?: "primary" | "danger" | "ghost";
|
||||||
type?: "button" | "submit" | "reset";
|
type?: "button" | "submit" | "reset";
|
||||||
|
size?: "sm";
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
style?: React.CSSProperties;
|
style?: React.CSSProperties;
|
||||||
@@ -47,9 +49,9 @@ export function Btn({
|
|||||||
const base: React.CSSProperties = {
|
const base: React.CSSProperties = {
|
||||||
border: "none",
|
border: "none",
|
||||||
borderRadius: "var(--radius)",
|
borderRadius: "var(--radius)",
|
||||||
padding: "8px 16px",
|
padding: size === "sm" ? "4px 10px" : "8px 16px",
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
fontSize: 13,
|
fontSize: size === "sm" ? 12 : 13,
|
||||||
cursor: disabled ? "not-allowed" : "pointer",
|
cursor: disabled ? "not-allowed" : "pointer",
|
||||||
opacity: disabled ? 0.6 : 1,
|
opacity: disabled ? 0.6 : 1,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ function emptyProduct() {
|
|||||||
return { name: "", sku: "", price: "", categoryId: "", taxId: "", description: "" };
|
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>) =>
|
return (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) =>
|
||||||
set((prev) => ({ ...prev, [key]: e.target.value }));
|
set((prev) => ({ ...prev, [key]: e.target.value }));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export default function UsersPage() {
|
|||||||
|
|
||||||
const openEdit = (user: User) => {
|
const openEdit = (user: User) => {
|
||||||
setSelected(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("");
|
setError("");
|
||||||
setModal("edit");
|
setModal("edit");
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
PORT=8080
|
PORT=8080
|
||||||
NODE_ENV=development
|
NODE_ENV=development
|
||||||
DATABASE_URL=file:./dev.db
|
DATABASE_URL=file:./prisma/dev.db
|
||||||
JWT_SECRET=change-me-in-production
|
JWT_SECRET=change-me-in-production
|
||||||
LOG_LEVEL=info
|
LOG_LEVEL=info
|
||||||
CORS_ORIGIN=http://localhost:5173
|
CORS_ORIGIN=http://localhost:5173
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import express from "express";
|
import express from "express";
|
||||||
import cors from "cors";
|
import cors from "cors";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
import healthRouter from "./routes/health.js";
|
import healthRouter from "./routes/health.js";
|
||||||
import authRouter from "./routes/auth.js";
|
import authRouter from "./routes/auth.js";
|
||||||
import vendorsRouter from "./routes/vendors.js";
|
import vendorsRouter from "./routes/vendors.js";
|
||||||
@@ -15,9 +14,6 @@ import eventsRouter from "./routes/events.js";
|
|||||||
import { errorHandler } from "./middleware/errorHandler.js";
|
import { errorHandler } from "./middleware/errorHandler.js";
|
||||||
import { requestLogger } from "./middleware/requestLogger.js";
|
import { requestLogger } from "./middleware/requestLogger.js";
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
|
||||||
const __dirname = path.dirname(__filename);
|
|
||||||
|
|
||||||
export function createApp() {
|
export function createApp() {
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user