mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-04 21:28:34 +08:00
fix(plugin-workflow-aggregate): limit aggregate instruction to only work on db data source (#5033)
This commit is contained in:
parent
70bb95bcaf
commit
65ec69cc62
@ -238,6 +238,11 @@ export default class extends Instruction {
|
||||
required: true,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'DataSourceCollectionCascader',
|
||||
'x-component-props': {
|
||||
dataSourceFilter(datasource) {
|
||||
return datasource.key === 'main' || datasource.options.isDBInstance;
|
||||
},
|
||||
},
|
||||
title: `{{t("Data of collection", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-reactions': [
|
||||
{
|
||||
|
@ -25,6 +25,10 @@ export default class extends Instruction {
|
||||
const options = processor.getParsedValue(params, node.id);
|
||||
const [dataSourceName, collectionName] = parseCollectionName(collection);
|
||||
const { collectionManager } = this.workflow.app.dataSourceManager.dataSources.get(dataSourceName);
|
||||
// @ts-ignore
|
||||
if (!collectionManager.db) {
|
||||
throw new Error('aggregate instruction can only work with data source of type database');
|
||||
}
|
||||
const repo = associated
|
||||
? collectionManager.getRepository(
|
||||
`${association?.associatedCollection}.${association.name}`,
|
||||
|
Loading…
Reference in New Issue
Block a user