feat: duplicate REST/GraphQL collections (#4211)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
Co-authored-by: nivedin <nivedinp@gmail.com>
This commit is contained in:
James George
2024-07-29 06:07:34 -07:00
committed by GitHub
parent c24d5c5302
commit c9f92282bf
26 changed files with 734 additions and 105 deletions

View File

@@ -20,11 +20,13 @@ import {
createGQLUserRequest,
deleteUserCollection,
deleteUserRequest,
duplicateUserCollection,
editGQLUserRequest,
updateUserCollection,
} from "./collections.api"
import * as E from "fp-ts/Either"
import { ReqType } from "../../api/generated/graphql"
import { moveOrReorderRequests } from "./collections.sync"
// gqlCollectionsMapper uses the collectionPath as the local identifier
@@ -261,6 +263,11 @@ export const storeSyncDefinition: StoreSyncDefinitionOf<
await deleteUserCollection(folderID)
}
},
async duplicateCollection({ collectionSyncID }) {
if (collectionSyncID) {
await duplicateUserCollection(collectionSyncID, ReqType.Gql)
}
},
editRequest({ path, requestIndex, requestNew }) {
const request = navigateToFolderWithIndexPath(
graphqlCollectionStore.value.state,