File tree Expand file tree Collapse file tree
api/internal/space/[id]/content Expand file tree Collapse file tree Original file line number Diff line number Diff 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" , {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments