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 { try {
const token = getToken(); const token = getToken();
if (!token) { if (!token) {
return null; return null;
} }
await HTTPService.put( const res = await HTTPService.put(
`${ENDPOINT}/collections/share-url/`, `${ENDPOINT}/collections/share-url`,
request, request,
null, null,
null,
{ {
'X-Auth-Token': token, 'X-Auth-Token': token,
} }
); );
return res.data as PublicURL;
} catch (e) { } catch (e) {
logError(e, 'updateShareableURL failed '); logError(e, 'updateShareableURL failed ');
throw e; throw e;