duplicate connection command

This commit is contained in:
Jan Prochazka
2021-04-29 13:25:12 +02:00
parent 47ea474555
commit c7d69b0fb5

View File

@@ -19,6 +19,13 @@
onConfirm: () => axiosInstance.post('connections/delete', data),
});
};
const handleDuplicate = () => {
axiosInstance.post('connections/save', {
...data,
_id: undefined,
displayName: `${data.displayName || data.server} - copy`,
});
};
const handleCreateDatabase = () => {
showModal(InputTextModal, {
header: 'Create database',
@@ -54,6 +61,10 @@
text: 'Delete',
onClick: handleDelete,
},
{
text: 'Duplicate',
onClick: handleDuplicate,
},
],
!data.singleDatabase && [
!$openedConnections.includes(data._id) && {