Show independent note descriptions, tags and image counts without author chrome
wiki CI and deployment / verify-and-deploy (push) Has been cancelled
wiki CI and deployment / verify-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -46,7 +46,7 @@ export async function upload(req:NextApiRequest,res:NextApiResponse,policy:Uploa
|
||||
}
|
||||
const postId=randomUUID();
|
||||
await transaction(async client=>{
|
||||
await client.query('INSERT INTO posts(id,slug,kind,title) VALUES($1,$2,$3,$4)',[postId,slug||postId,kind,title]);
|
||||
await client.query('INSERT INTO posts(id,slug,kind,title,description) VALUES($1,$2,$3,$4,$5)',[postId,slug||postId,kind,title,description.slice(0,1000)||title]);
|
||||
for(const [position,a] of records.entries()){
|
||||
await client.query('INSERT INTO assets(id,kind,filename,storage_key,mime_type,byte_size,sha256,width,height,duration,has_audio,processing_status) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12)',[a.id,kind,a.filename,a.key,a.mime,a.size,a.hash,a.width,a.height,a.duration,a.hasAudio,kind==='video'?'pending':'ready']);
|
||||
await client.query('INSERT INTO post_assets(post_id,asset_id,position) VALUES($1,$2,$3)',[postId,a.id,position]);
|
||||
|
||||
Reference in New Issue
Block a user