Mongoose - fix post callback (#9850)

* fix post function

* fix tests
This commit is contained in:
Cao Jiannan
2016-06-29 10:46:09 +09:00
committed by Horiuchi_H
parent 3e0a7abcfd
commit 43449c604f
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -369,7 +369,7 @@ schema.path('name');
schema.path('name', Number);
schema.pathType('name');
schema.plugin(function() {});
schema.post('save', function(next: () => void, doc: IActor) {});
schema.post('save', function(doc: IActor) {});
schema.pre('save', function(next: () => void) {});
schema.requiredPaths();
schema.static('findByName', function(name: string, callback: () => void) {});
+1 -2
View File
@@ -276,8 +276,7 @@ declare module "mongoose" {
pre(method: string, fn: HookSyncCallback, errorCb?: HookErrorCallback): Schema;
pre(method: string, isAsync: boolean, fn: HookAsyncCallback, errorCb?: HookErrorCallback): Schema;
post(method: string, fn: HookSyncCallback, errorCb?: HookErrorCallback): Schema;
post(method: string, isAsync: boolean, fn: HookAsyncCallback, errorCb?: HookErrorCallback): Schema;
post(method: string, fn: (doc: Document, next?: HookNextFunction) => any ): Schema;
requiredPaths(): string[];
set(key: string, value: any): void;