refactor: update gql properties sync

This commit is contained in:
nivedin
2023-12-08 15:01:33 +05:30
committed by Andrew Bastin
parent c18e801420
commit 83019733e3

View File

@@ -21,7 +21,7 @@ import {
deleteUserCollection,
deleteUserRequest,
editGQLUserRequest,
renameUserCollection,
updateUserCollection,
} from "./collections.api"
import * as E from "fp-ts/Either"
@@ -158,8 +158,13 @@ export const storeSyncDefinition: StoreSyncDefinitionOf<
[collectionIndex]
)?.id
if (collectionID && collection.name) {
renameUserCollection(collectionID, collection.name)
const data = {
auth: collection.auth,
headers: collection.headers,
}
if (collectionID) {
updateUserCollection(collectionID, collection.name, JSON.stringify(data))
}
},
async addFolder({ name, path }) {
@@ -197,8 +202,13 @@ export const storeSyncDefinition: StoreSyncDefinitionOf<
path.split("/").map((index) => parseInt(index))
)?.id
if (folderBackendId && folder.name) {
renameUserCollection(folderBackendId, folder.name)
const data = {
auth: folder.auth,
headers: folder.headers,
}
if (folderBackendId) {
updateUserCollection(folderBackendId, folder.name, JSON.stringify(data))
}
},
async removeFolder({ folderID }) {