aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-07-05 13:54:50 +0300
committereug-vs <eug-vs@keemail.me>2020-07-05 13:54:50 +0300
commit4eaced8b6c21f5171823166ad2e2e393d7c78353 (patch)
tree0796f254db06ec16ef985eff5c187a63efff91db
parent96398e544463651413ea80821c09ae7573f46cb1 (diff)
downloadwhich-api-4eaced8b6c21f5171823166ad2e2e393d7c78353.tar.gz
hotfix: compareUser ts error
-rw-r--r--services/users/users.hooks.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/users/users.hooks.ts b/services/users/users.hooks.ts
index 125f418..29f1074 100644
--- a/services/users/users.hooks.ts
+++ b/services/users/users.hooks.ts
@@ -15,7 +15,7 @@ const ignoreCaseRegex = async (context: HookContext): Promise<HookContext> => {
};
const compareUser = async (context: HookContext): Promise<HookContext> => {
- if (context.arguments[0] !== context.params.user._id) {
+ if (context.id !== context.params.user._id.toString()) {
throw new NotAuthenticated('You can only PATCH/UPDATE your own user!');
}
return context;