mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
⚡ Add the posiblity to set multi-select fields with the names (#1892)
* ⚡ Add the posiblity to set multi-select fields with the names * 🐛 Fix issue with expressions Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
@@ -47,6 +47,7 @@ import {
|
||||
databasePageFields,
|
||||
databasePageOperations,
|
||||
} from './DatabasePageDescription';
|
||||
import { getServers } from 'dns';
|
||||
|
||||
export class Notion implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
@@ -215,8 +216,16 @@ export class Notion implements INodeType {
|
||||
const resource = this.getCurrentNodeParameter('resource') as string;
|
||||
const operation = this.getCurrentNodeParameter('operation') as string;
|
||||
const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`);
|
||||
const useNames = (resource === 'databasePage' && operation === 'getAll');
|
||||
return (properties[name][type].options).map((option: IDataObject) => ({ name: option.name, value: (['select', 'multi_select'].includes(type) && useNames) ? option.name : option.id }));
|
||||
if (resource === 'databasePage') {
|
||||
if (['multi_select', 'select'].includes(type) && operation === 'getAll') {
|
||||
return (properties[name][type].options)
|
||||
.map((option: IDataObject) => ({ name: option.name, value: option.name }));
|
||||
} else if (['multi_select'].includes(type) && ['create', 'update'].includes(operation)) {
|
||||
return (properties[name][type].options)
|
||||
.map((option: IDataObject) => ({ name: option.name, value: option.name }));
|
||||
}
|
||||
}
|
||||
return (properties[name][type].options).map((option: IDataObject) => ({ name: option.name, value: option.id }));
|
||||
},
|
||||
async getUsers(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
|
||||
Reference in New Issue
Block a user