diff --git a/src/services/collectionService.ts b/src/services/collectionService.ts index 83c83fe17..948d1ff67 100644 --- a/src/services/collectionService.ts +++ b/src/services/collectionService.ts @@ -22,6 +22,7 @@ import { RemoveFromCollectionRequest, CreatePublicAccessTokenRequest, PublicURL, + UpdatePublicURL, } from 'types/collection'; import { COLLECTION_SORT_BY, CollectionType } from 'constants/collection'; @@ -619,6 +620,27 @@ export const deleteShareableURL = async (collection: Collection) => { } }; +export const updateShareableURL = async (request: UpdatePublicURL) => { + try { + const token = getToken(); + if (!token) { + return null; + } + await HTTPService.put( + `${ENDPOINT}/collections/share-url/`, + request, + null, + null, + { + 'X-Auth-Token': token, + } + ); + } catch (e) { + logError(e, 'updateShareableURL failed '); + throw e; + } +}; + export const getFavCollection = async () => { const collections = await getLocalCollections(); for (const collection of collections) {