Spaces:
Configuration error
Configuration error
File size: 534 Bytes
6ce9b06 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```typescript
import { readProjects, writeProjects } from "../routes/projects.store.js";
export const projectCreate = {
name: "project.create",
async run(input: { projectId: string; text: string }) {
const name = input.text.split(":")[1]?.trim() || `Projet ${new Date().toISOString()}`;
const db = readProjects();
const id = "p_" + Math.random().toString(16).slice(2);
db.projects.push({ id, name, createdAt: Date.now() });
writeProjects(db);
return `Projet créé ✅ id=${id} name="${name}"`;
}
};
``` |