Unify content under ID-based note dialogs with lightweight previews and Studio proxy
This commit is contained in:
@@ -13,6 +13,10 @@ export async function getPost(slug: string): Promise<Post | null> {
|
||||
const result = await db().query(`${expand} WHERE p.slug=$1`,[slug]);
|
||||
return serialize(result.rows,await tags())[0] || null;
|
||||
}
|
||||
export async function getPostById(id:string):Promise<Post|null>{
|
||||
const result=await db().query(`${expand} WHERE p.id=$1`,[id]);
|
||||
return serialize(result.rows,await tags())[0]||null;
|
||||
}
|
||||
export async function feed(options: {kind?: PostKind; path?: string; cursor?: string; q?: string} = {}): Promise<FeedData> {
|
||||
const allTags=await tags(); const target=options.path ? allTags.find(t=>t.path===options.path) : undefined;
|
||||
if(options.path&&!target) throw new Error("Tag not found");
|
||||
|
||||
Reference in New Issue
Block a user