Added filterable stash pages.

This commit is contained in:
2024-03-15 00:08:24 +01:00
parent 7f00e31fc4
commit a1b45cb721
39 changed files with 649218 additions and 80 deletions

View File

@@ -46,17 +46,17 @@ export async function fetchUser(userId, options = {}) {
.groupBy('users.id', 'users_roles.role')
.first();
const stashes = await knex('stashes')
.where('user_id', user.id)
.leftJoin('stashes_meta', 'stashes_meta.stash_id', 'stashes.id');
if (!user) {
throw HttpError(`User '${userId}' not found`, 404);
}
if (options.raw) {
return user;
return { user, stashes };
}
const stashes = await knex('stashes')
.where('user_id', user.id)
.leftJoin('stashes_meta', 'stashes_meta.stash_id', 'stashes.id');
return curateUser(user, { stashes });
}