2
0
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:
wolflu05
2024-09-18 11:24:01 +02:00
parent 5ec5aa7264
commit a72d845271
5 changed files with 40 additions and 33 deletions

View File

@ -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]) {