create collection - generic operation

This commit is contained in:
Jan Prochazka
2024-08-16 12:40:44 +02:00
parent ecde2da2af
commit a89cb607b4
12 changed files with 174 additions and 18 deletions

View File

@@ -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>