forked from cory/tildefriends
Let's try only showing my own blog posts.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4755 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
2384fc9fa9
commit
9e5e7b70d4
@ -1,5 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "🪵",
|
||||
"previous": "&/KFqTPF8mpU1UEFMAsKMtjQxTNTR1W78PIfx+OkCbF0=.sha256"
|
||||
"previous": "&TIrBnpN3iz3O9L9MCCteAcVJZjA83EKdcfu4SCM76VE=.sha256"
|
||||
}
|
@ -141,6 +141,7 @@ export function render_atom(blogs) {
|
||||
|
||||
export async function get_posts() {
|
||||
let blogs = [];
|
||||
let ids = await ssb.getIdentities();
|
||||
await ssb.sqlAsync(`
|
||||
WITH
|
||||
blogs AS (
|
||||
@ -177,10 +178,11 @@ export async function get_posts() {
|
||||
name IS NOT NULL)
|
||||
WHERE author_rank = 1)
|
||||
SELECT blogs.*, names.name FROM blogs
|
||||
JOIN json_each(?) AS self ON self.value = blogs.author
|
||||
JOIN public ON public.author = blogs.author
|
||||
LEFT OUTER JOIN names ON names.author = blogs.author
|
||||
ORDER BY blogs.timestamp DESC LIMIT 20
|
||||
`, [], function(row) {
|
||||
`, [JSON.stringify(ids)], function(row) {
|
||||
blogs.push(row);
|
||||
});
|
||||
return blogs;
|
||||
|
Loading…
Reference in New Issue
Block a user