Added secondary stash button, centralized bookmark (heart) component.
This commit is contained in:
@@ -51,13 +51,14 @@ export async function fetchUser(userId, options = {}, reqUser) {
|
||||
}
|
||||
|
||||
const stashes = await knex('stashes')
|
||||
.select('stashes.*', 'stashes_meta.*')
|
||||
.leftJoin('stashes_meta', 'stashes_meta.stash_id', 'stashes.id')
|
||||
.where('user_id', user.id)
|
||||
.modify((builder) => {
|
||||
if (reqUser?.id !== user.id && !options.includeStashes) {
|
||||
builder.where('public', true);
|
||||
}
|
||||
})
|
||||
.leftJoin('stashes_meta', 'stashes_meta.stash_id', 'stashes.id');
|
||||
});
|
||||
|
||||
if (options.raw) {
|
||||
return { user, stashes };
|
||||
|
||||
Reference in New Issue
Block a user