Use getMetadata instead of getOwnMetadata

This commit is contained in:
Jerko Steiner 2019-08-27 20:33:21 +07:00
parent c7ab4fe387
commit 9262cb636e
2 changed files with 2 additions and 2 deletions

View File

@ -27,5 +27,5 @@ export function getValidatorsForMethod<Context>(
target: any,
method: string,
): Array<Validate<Context>> {
return Reflect.getOwnMetadata(ensureKey, target, method) || []
return Reflect.getMetadata(ensureKey, target, method) || []
}

View File

@ -108,7 +108,7 @@ export const createRpcService = <T, M extends FunctionPropertyNames<T>>(
}
const validators = getValidatorsForMethod<Context>(
(service as any).__proto__, method)
(service as any), method)
validators.forEach(v => {
const success = v(context)