Added dynamic affiliate URLs and video player restrictions.
This commit is contained in:
18
src/users.js
18
src/users.js
@@ -29,6 +29,7 @@ export function curateUser(user, _assets = {}) {
|
||||
isIdentityVerified: user.identity_verified,
|
||||
avatar: `/media/avatars/${user.id}_${user.username}.png`,
|
||||
role: user.role,
|
||||
abilities: user.abilities,
|
||||
createdAt: user.created_at,
|
||||
};
|
||||
|
||||
@@ -61,23 +62,6 @@ export async function fetchUser(userId, options = {}, _reqUser) {
|
||||
throw new HttpError(`User '${userId}' not found`, 404);
|
||||
}
|
||||
|
||||
/*
|
||||
const [stashes, templates] = await Promise.all([
|
||||
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);
|
||||
}
|
||||
}),
|
||||
options.includeTemplates
|
||||
? knex('users_templates').where('user_id', user.id)
|
||||
: null,
|
||||
]);
|
||||
*/
|
||||
|
||||
if (options.raw) {
|
||||
// return { user, stashes, templates };
|
||||
return { user };
|
||||
|
||||
Reference in New Issue
Block a user