mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 04:25:42 +00:00
allow to specify the function name via the source file string divided by a colon
This commit is contained in:
@ -37,6 +37,12 @@ export async function findExternalPluginFunction(
|
||||
source: string,
|
||||
functionName: string
|
||||
): Promise<Function | null> {
|
||||
// The source URL may also include the function name divided by a colon
|
||||
// otherwise the provided function name will be used
|
||||
if (source.includes(':')) {
|
||||
[source, functionName] = source.split(':');
|
||||
}
|
||||
|
||||
const module = await loadExternalPluginSource(source);
|
||||
|
||||
if (module && module[functionName]) {
|
||||
|
Reference in New Issue
Block a user