refactor: update coll properties when syncing

This commit is contained in:
nivedin
2023-12-08 14:57:59 +05:30
committed by Andrew Bastin
parent bb8c77fa7a
commit c18e801420
7 changed files with 64 additions and 22 deletions

View File

@@ -65,6 +65,9 @@ import {
GetGqlRootUserCollectionsQueryVariables,
GetGqlRootUserCollectionsDocument,
ReqType,
UpdateUserCollectionMutation,
UpdateUserCollectionMutationVariables,
UpdateUserCollectionDocument,
} from "../../api/generated/graphql"
export const createRESTRootUserCollection = (title: string) =>
@@ -160,6 +163,17 @@ export const renameUserCollection = (
""
>(RenameUserCollectionDocument, { userCollectionID, newTitle })()
export const updateUserCollection = (
userCollectionID: string,
newTitle?: string,
data?: string
) =>
runMutation<
UpdateUserCollectionMutation,
UpdateUserCollectionMutationVariables,
""
>(UpdateUserCollectionDocument, { userCollectionID, newTitle, data })()
export const moveUserCollection = (
sourceCollectionID: string,
destinationCollectionID?: string