mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 08:26:01 +00:00
create collection - generic operation
This commit is contained in:
@@ -14,6 +14,22 @@
|
||||
if (syncModel) apiCall('database-connections/sync-model', { conid, database });
|
||||
}
|
||||
}
|
||||
|
||||
export async function runOperationOnDatabase({ conid, database }, operation, syncModel = true) {
|
||||
const resp = await apiCall('database-connections/run-operation', {
|
||||
conid,
|
||||
database,
|
||||
operation,
|
||||
});
|
||||
|
||||
const { errorMessage } = resp || {};
|
||||
if (errorMessage) {
|
||||
showModal(ErrorMessageModal, { title: 'Error when executing operation', message: errorMessage });
|
||||
} else {
|
||||
showSnackbarSuccess('Saved to database');
|
||||
if (syncModel) apiCall('database-connections/sync-model', { conid, database });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user