Fixed members handling
This commit is contained in:
@@ -35,10 +35,15 @@ export const hasUserClubAccess = async(userId, clubId) => {
|
||||
}
|
||||
|
||||
export const checkAccess = async(userToken, clubId) => {
|
||||
const user = await getUserByToken(userToken);
|
||||
if (!await hasUserClubAccess(user.id, clubId)) {
|
||||
console.log('no club access');
|
||||
const err = new HttpError('noaccess', 403);
|
||||
throw err;
|
||||
try {
|
||||
const user = await getUserByToken(userToken);
|
||||
if (!await hasUserClubAccess(user.id, clubId)) {
|
||||
console.log('no club access');
|
||||
const err = new HttpError('noaccess', 403);
|
||||
throw err;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user