mirror of
				https://github.com/Fabio286/antares.git
				synced 2025-06-05 21:59:22 +02:00 
			
		
		
		
	fix: deletion of rows from query results
This commit is contained in:
		| @@ -157,9 +157,13 @@ export default (connections) => { | |||||||
|  |  | ||||||
|    ipcMain.handle('delete-table-rows', async (event, params) => { |    ipcMain.handle('delete-table-rows', async (event, params) => { | ||||||
|       if (params.primary) { |       if (params.primary) { | ||||||
|          const idString = params.rows.map(row => typeof row[params.primary] === 'string' |          const idString = params.rows.map(row => { | ||||||
|             ? `"${row[params.primary]}"` |             const fieldName = Object.keys(row)[0].includes('.') ? `${params.table}.${params.primary}` : params.primary; | ||||||
|             : row[params.primary]).join(','); |  | ||||||
|  |             return typeof row[fieldName] === 'string' | ||||||
|  |                ? `"${row[fieldName]}"` | ||||||
|  |                : row[fieldName]; | ||||||
|  |          }).join(','); | ||||||
|  |  | ||||||
|          try { |          try { | ||||||
|             const result = await connections[params.uid] |             const result = await connections[params.uid] | ||||||
|   | |||||||
| @@ -42,6 +42,7 @@ export default { | |||||||
|  |  | ||||||
|          try { |          try { | ||||||
|             const { status, response } = await Tables.deleteTableRows(params); |             const { status, response } = await Tables.deleteTableRows(params); | ||||||
|  |             this.isQuering = false; | ||||||
|  |  | ||||||
|             if (status === 'success') |             if (status === 'success') | ||||||
|                this.reloadTable(); |                this.reloadTable(); | ||||||
| @@ -50,9 +51,8 @@ export default { | |||||||
|          } |          } | ||||||
|          catch (err) { |          catch (err) { | ||||||
|             this.addNotification({ status: 'error', message: err.stack }); |             this.addNotification({ status: 'error', message: err.stack }); | ||||||
|  |             this.isQuering = false; | ||||||
|          } |          } | ||||||
|  |  | ||||||
|          this.isQuering = false; |  | ||||||
|       } |       } | ||||||
|    } |    } | ||||||
| }; | }; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user