collectionService: method for updating sharable url
This commit is contained in:
parent
2cb2511429
commit
5646fff10b
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue