mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 11:56:00 +00:00
new collection refactor
This commit is contained in:
@@ -294,24 +294,7 @@ registerCommand({
|
||||
|
||||
showModal(NewCollectionModal, {
|
||||
driver,
|
||||
onConfirm: async values => {
|
||||
// await apiCall('database-connections/run-script', { ...dbid, sql: `db.createCollection('${newCollection}')` });
|
||||
const resp = await apiCall('database-connections/run-operation', {
|
||||
...dbid,
|
||||
operation: {
|
||||
type: 'createCollection',
|
||||
collection: values,
|
||||
},
|
||||
});
|
||||
|
||||
const { errorMessage } = resp || {};
|
||||
if (errorMessage) {
|
||||
showModal(ErrorMessageModal, { title: 'Error when executing operation', message: errorMessage });
|
||||
} else {
|
||||
showSnackbarSuccess('Saved to database');
|
||||
apiCall('database-connections/sync-model', dbid);
|
||||
}
|
||||
},
|
||||
dbid,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user