Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Fix default team handling

Tomas Valentaf118cf81b763
diff --git a/components/AgentLogFilesList.tsx b/components/AgentLogFilesList.tsx
index cc5cc83eb..3ef52ef23 100644
--- a/components/AgentLogFilesList.tsx
+++ b/components/AgentLogFilesList.tsx
@@ -40,7 +40,6 @@ function AgentLogFilesList({
async function handleUpload(file: BufferFile) {
const text = await file.text()
- // console.log('text >>>>>>>>>', text)
const log = await uploadFile({
content: text,
filename: file.name,
diff --git a/pages/index.tsx b/pages/index.tsx
index eaffd3142..6390b9f3e 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -90,15 +90,15 @@ export const getServerSideProps: GetServerSideProps<Props> = async (ctx) => {
users: {
connect: {
id: session.user.id,
- }
- }
- }
+ },
+ },
+ },
},
},
})
const defaultProject =
- defaultTeam.projects.find(p => p.is_default) ||
+ user.users_teams.flatMap(u => u.teams.projects).find(p => p.is_default) ||
await prisma.projects.create({
data: {
id: nanoid(),
@@ -115,12 +115,10 @@ export const getServerSideProps: GetServerSideProps<Props> = async (ctx) => {
},
})
-
return {
props: {
defaultProjectID: defaultProject.id,
- projects: defaultTeam
- .projects
+ projects: [defaultProject]
.map<projects & { logs: LogFile[], deployments: deployments[] }>(p => {
return {
...p,
@@ -149,7 +147,7 @@ export interface Props {
}
function Home({ projects, defaultProjectID }: Props) {
-
+ console.log(defaultProjectID)
return (
<DashboardHome
defaultProjectID={defaultProjectID}