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