mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
⚡ Small improvements on Cockpit-Node
This commit is contained in:
@@ -50,24 +50,19 @@ export async function getAllCollectionEntries(this: IExecuteFunctions | IExecute
|
||||
body.populate = options.populate as boolean;
|
||||
}
|
||||
|
||||
if (options.simple) {
|
||||
body.simple = options.simple as boolean;
|
||||
body.simple = true;
|
||||
if (options.rawData) {
|
||||
body.simple = !options.rawData as boolean;
|
||||
}
|
||||
|
||||
if (options.language) {
|
||||
body.lang = options.language as string;
|
||||
}
|
||||
|
||||
const resultData = await cockpitApiRequest.call(this, 'post', `/collections/get/${resourceName}`, body);
|
||||
|
||||
if (options.rawData === true) {
|
||||
return resultData;
|
||||
}
|
||||
|
||||
return (resultData as unknown as IDataObject).entries;
|
||||
return cockpitApiRequest.call(this, 'post', `/collections/get/${resourceName}`, body);
|
||||
}
|
||||
|
||||
|
||||
export async function getAllCollectionNames(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions): Promise<string[]> {
|
||||
return cockpitApiRequest.call(this, 'GET', `/collections/listCollections`, {});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user