mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-28 22:19:41 -08:00
fix(Supabase Node): Reset query parameters in get many operation (#11630)
This commit is contained in:
parent
38fefff348
commit
74582290c0
|
@ -124,14 +124,16 @@ export class Supabase implements INodeType {
|
||||||
const items = this.getInputData();
|
const items = this.getInputData();
|
||||||
const returnData: INodeExecutionData[] = [];
|
const returnData: INodeExecutionData[] = [];
|
||||||
const length = items.length;
|
const length = items.length;
|
||||||
const qs: IDataObject = {};
|
let qs: IDataObject = {};
|
||||||
const resource = this.getNodeParameter('resource', 0);
|
const resource = this.getNodeParameter('resource', 0);
|
||||||
const operation = this.getNodeParameter('operation', 0);
|
const operation = this.getNodeParameter('operation', 0);
|
||||||
|
|
||||||
if (resource === 'row') {
|
if (resource === 'row') {
|
||||||
|
const tableId = this.getNodeParameter('tableId', 0) as string;
|
||||||
|
|
||||||
if (operation === 'create') {
|
if (operation === 'create') {
|
||||||
const records: IDataObject[] = [];
|
const records: IDataObject[] = [];
|
||||||
const tableId = this.getNodeParameter('tableId', 0) as string;
|
|
||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
const record: IDataObject = {};
|
const record: IDataObject = {};
|
||||||
const dataToSend = this.getNodeParameter('dataToSend', 0) as
|
const dataToSend = this.getNodeParameter('dataToSend', 0) as
|
||||||
|
@ -185,7 +187,6 @@ export class Supabase implements INodeType {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (operation === 'delete') {
|
if (operation === 'delete') {
|
||||||
const tableId = this.getNodeParameter('tableId', 0) as string;
|
|
||||||
const filterType = this.getNodeParameter('filterType', 0) as string;
|
const filterType = this.getNodeParameter('filterType', 0) as string;
|
||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
let endpoint = `/${tableId}`;
|
let endpoint = `/${tableId}`;
|
||||||
|
@ -241,7 +242,6 @@ export class Supabase implements INodeType {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (operation === 'get') {
|
if (operation === 'get') {
|
||||||
const tableId = this.getNodeParameter('tableId', 0) as string;
|
|
||||||
const endpoint = `/${tableId}`;
|
const endpoint = `/${tableId}`;
|
||||||
|
|
||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
|
@ -281,11 +281,13 @@ export class Supabase implements INodeType {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (operation === 'getAll') {
|
if (operation === 'getAll') {
|
||||||
const tableId = this.getNodeParameter('tableId', 0) as string;
|
|
||||||
const returnAll = this.getNodeParameter('returnAll', 0);
|
const returnAll = this.getNodeParameter('returnAll', 0);
|
||||||
const filterType = this.getNodeParameter('filterType', 0) as string;
|
const filterType = this.getNodeParameter('filterType', 0) as string;
|
||||||
|
|
||||||
let endpoint = `/${tableId}`;
|
let endpoint = `/${tableId}`;
|
||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
|
qs = {}; // reset qs
|
||||||
|
|
||||||
if (filterType === 'manual') {
|
if (filterType === 'manual') {
|
||||||
const matchType = this.getNodeParameter('matchType', 0) as string;
|
const matchType = this.getNodeParameter('matchType', 0) as string;
|
||||||
const keys = this.getNodeParameter('filters.conditions', i, []) as IDataObject[];
|
const keys = this.getNodeParameter('filters.conditions', i, []) as IDataObject[];
|
||||||
|
@ -342,7 +344,6 @@ export class Supabase implements INodeType {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (operation === 'update') {
|
if (operation === 'update') {
|
||||||
const tableId = this.getNodeParameter('tableId', 0) as string;
|
|
||||||
const filterType = this.getNodeParameter('filterType', 0) as string;
|
const filterType = this.getNodeParameter('filterType', 0) as string;
|
||||||
let endpoint = `/${tableId}`;
|
let endpoint = `/${tableId}`;
|
||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
|
|
Loading…
Reference in a new issue