mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 04:33:57 +00:00
SYNC: Merge pull request #12 from dbgate/feature/team-files
This commit is contained in:
@@ -15,11 +15,14 @@ export default async function saveTabFile(editor, saveMode, folder, format, file
|
||||
const tabs = get(openedTabs);
|
||||
const tabid = editor.activator.tabid;
|
||||
const data = editor.getData();
|
||||
const { savedFile, savedFilePath, savedFolder, savedCloudFolderId, savedCloudContentId } =
|
||||
const { savedFile, savedFilePath, savedFolder, savedCloudFolderId, savedCloudContentId, savedTeamFileId } =
|
||||
tabs.find(x => x.tabid == tabid).props || {};
|
||||
|
||||
const handleSave = async () => {
|
||||
if (savedCloudFolderId && savedCloudContentId) {
|
||||
if (savedTeamFileId) {
|
||||
const resp = await apiCall('team-files/update', { teamFileId: savedTeamFileId, data });
|
||||
markTabSaved(tabid);
|
||||
} else if (savedCloudFolderId && savedCloudContentId) {
|
||||
const resp = await apiCall('cloud/save-file', {
|
||||
folid: savedCloudFolderId,
|
||||
fileName: savedFile,
|
||||
|
||||
Reference in New Issue
Block a user