mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
21 lines
584 B
TypeScript
21 lines
584 B
TypeScript
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
|
|
|
|
import { apiRequest } from '../../../transport';
|
|
|
|
export async function del(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]> {
|
|
const body: IDataObject = {};
|
|
const requestMethod = 'DELETE';
|
|
|
|
//meta data
|
|
const fileId: string = this.getNodeParameter('fileId', index) as string;
|
|
|
|
//endpoint
|
|
const endpoint = `files/${fileId}`;
|
|
|
|
//response
|
|
await apiRequest.call(this, requestMethod, endpoint, body);
|
|
|
|
//return
|
|
return this.helpers.returnJsonArray({ success: true });
|
|
}
|