Skip to content

Commit 615145c

Browse files
committed
Devin and graphite suggestions
1 parent d43d61e commit 615145c

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

apps/website/app/api/internal/space/[id]/content/route.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,16 @@ export const POST = async (
3939
const body = (await request.json()) as StandaloneCrossAppContent[];
4040
// TODO: Zed validator
4141
const content = body
42-
.map((c) => crossAppStandaloneContentToDbContent(c, { dbId: spaceId }))
42+
.map((c) =>
43+
crossAppStandaloneContentToDbContent(
44+
{
45+
...c,
46+
createdAt: new Date(c.createdAt),
47+
modifiedAt: new Date(c.modifiedAt || c.createdAt),
48+
},
49+
{ dbId: spaceId },
50+
),
51+
)
4352
.filter((c) => c !== undefined);
4453
if (content.length === 0) throw new Error("Could not translate content");
4554
const result = await supabase.rpc("upsert_content", {

apps/website/app/utils/supabase/account.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const getAccountId = async (
1717
.eq("dg_account", id)
1818
.eq("agent_type", "person")
1919
.maybeSingle();
20+
if (accountReq.error) throw accountReq.error;
2021
return accountReq.data?.id;
2122
};
2223

0 commit comments

Comments
 (0)