diff options
author | eug-vs <eug-vs@keemail.me> | 2020-07-05 13:54:50 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-07-05 13:54:50 +0300 |
commit | 4eaced8b6c21f5171823166ad2e2e393d7c78353 (patch) | |
tree | 0796f254db06ec16ef985eff5c187a63efff91db | |
parent | 96398e544463651413ea80821c09ae7573f46cb1 (diff) | |
download | which-api-4eaced8b6c21f5171823166ad2e2e393d7c78353.tar.gz |
hotfix: compareUser ts error
-rw-r--r-- | services/users/users.hooks.ts | 2 |
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; |