cli: use model scope for hook calls
authorFelix Fietkau <nbd@nbd.name>
Wed, 26 Feb 2025 09:35:02 +0000 (10:35 +0100)
committerFelix Fietkau <nbd@nbd.name>
Wed, 26 Feb 2025 09:35:03 +0000 (10:35 +0100)
Make the scope consistent with other callbacks

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/utils/cli/files/usr/share/ucode/cli/datamodel.uc

index bc78a7b12bbc65c94ca39dbaae77730576027145..f6d9454dd7e3db5cb3ef575f09e5f8f2ed435bbf 100644 (file)
@@ -122,7 +122,7 @@ function run_hook(name, ...args)
                return;
 
        for (let hook in hooks)
-               call(hook, this, {}, ...args);
+               call(hook, this, this.scope, ...args);
 }
 
 function init()