(key: IntegrationTaskKey, records: { id: string; fields: Partial<TFields> }[])
| 96 | } |
| 97 | |
| 98 | updateRecords(key: IntegrationTaskKey, records: { id: string; fields: Partial<TFields> }[]) { |
| 99 | return this.runTask( |
| 100 | key, |
| 101 | async (client) => { |
| 102 | const result = await client |
| 103 | .base(this.baseId) |
| 104 | // official types are wrong - we need to use our extended AirtableFieldSet here |
| 105 | // @ts-ignore |
| 106 | .table<TFields>(this.tableName) |
| 107 | .update(records); |
| 108 | return result.map((record) => toSerializableRecord<TFields>(record)); |
| 109 | }, |
| 110 | { |
| 111 | name: "Update Records", |
| 112 | params: records, |
| 113 | properties: [ |
| 114 | ...tableParams({ baseId: this.baseId, tableName: this.tableName }), |
| 115 | { label: "Updated records", text: records.length.toString() }, |
| 116 | ], |
| 117 | } |
| 118 | ); |
| 119 | } |
| 120 | |
| 121 | deleteRecords(key: IntegrationTaskKey, recordIds: string[]) { |
| 122 | return this.runTask( |
no test coverage detected