Fix minor bug in put share-url api call

This commit is contained in:
Neeraj Gupta 2022-02-28 13:48:30 +05:30
parent 5646fff10b
commit a6a4ecbf46
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1

View file

@ -620,21 +620,23 @@ export const deleteShareableURL = async (collection: Collection) => {
}
};
export const updateShareableURL = async (request: UpdatePublicURL) => {
export const updateShareableURL = async (
request: UpdatePublicURL
): Promise<PublicURL> => {
try {
const token = getToken();
if (!token) {
return null;
}
await HTTPService.put(
`${ENDPOINT}/collections/share-url/`,
const res = await HTTPService.put(
`${ENDPOINT}/collections/share-url`,
request,
null,
null,
{
'X-Auth-Token': token,
}
);
return res.data as PublicURL;
} catch (e) {
logError(e, 'updateShareableURL failed ');
throw e;