MCPcopy Create free account
hub / github.com/TanStack/db / handleCreateProject

Function handleCreateProject

examples/react/projects/src/routes/_authenticated.tsx:30–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 }
29
30 const handleCreateProject = () => {
31 if (newProjectName.trim() && session) {
32 projectCollection.insert({
33 id: Math.floor(Math.random() * 100000),
34 name: newProjectName.trim(),
35 description: ``,
36 owner_id: session.user.id,
37 shared_user_ids: [],
38 created_at: new Date(),
39 updated_at: new Date(),
40 })
41 setNewProjectName(``)
42 setShowNewProjectForm(false)
43 }
44 }
45
46 if (isPending) {
47 return null

Callers 1

AuthenticatedLayoutFunction · 0.85

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected