fix(Supabase Node): Reset query parameters in get many operation (#11630)

This commit is contained in:
Michael Kret 2024-11-08 16:27:56 +02:00 committed by GitHub
parent 38fefff348
commit 74582290c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -124,14 +124,16 @@ export class Supabase implements INodeType {
const items = this.getInputData();
const returnData: INodeExecutionData[] = [];
const length = items.length;
const qs: IDataObject = {};
let qs: IDataObject = {};
const resource = this.getNodeParameter('resource', 0);
const operation = this.getNodeParameter('operation', 0);
if (resource === 'row') {
const tableId = this.getNodeParameter('tableId', 0) as string;
if (operation === 'create') {
const records: IDataObject[] = [];
const tableId = this.getNodeParameter('tableId', 0) as string;
for (let i = 0; i < length; i++) {
const record: IDataObject = {};
const dataToSend = this.getNodeParameter('dataToSend', 0) as
@ -185,7 +187,6 @@ export class Supabase implements INodeType {
}
if (operation === 'delete') {
const tableId = this.getNodeParameter('tableId', 0) as string;
const filterType = this.getNodeParameter('filterType', 0) as string;
for (let i = 0; i < length; i++) {
let endpoint = `/${tableId}`;
@ -241,7 +242,6 @@ export class Supabase implements INodeType {
}
if (operation === 'get') {
const tableId = this.getNodeParameter('tableId', 0) as string;
const endpoint = `/${tableId}`;
for (let i = 0; i < length; i++) {
@ -281,11 +281,13 @@ export class Supabase implements INodeType {
}
if (operation === 'getAll') {
const tableId = this.getNodeParameter('tableId', 0) as string;
const returnAll = this.getNodeParameter('returnAll', 0);
const filterType = this.getNodeParameter('filterType', 0) as string;
let endpoint = `/${tableId}`;
for (let i = 0; i < length; i++) {
qs = {}; // reset qs
if (filterType === 'manual') {
const matchType = this.getNodeParameter('matchType', 0) as string;
const keys = this.getNodeParameter('filters.conditions', i, []) as IDataObject[];
@ -342,7 +344,6 @@ export class Supabase implements INodeType {
}
if (operation === 'update') {
const tableId = this.getNodeParameter('tableId', 0) as string;
const filterType = this.getNodeParameter('filterType', 0) as string;
let endpoint = `/${tableId}`;
for (let i = 0; i < length; i++) {