Common: add share method

This commit is contained in:
Viktor Fomin 2023-11-21 12:48:06 +03:00
parent 01b2f99be9
commit c661200804
2 changed files with 17 additions and 10 deletions

View File

@ -1039,7 +1039,7 @@ export function changeDocumentServiceLocation(
});
}
export function getExternalLinks(fileId, startIndex = 0, count = 5) {
export function getExternalLinks(fileId, startIndex = 0, count = 50) {
const linkParams = `?startIndex=${startIndex}&count=${count}`;
return request({
@ -1058,13 +1058,15 @@ export function getPrimaryLink(fileId) {
export function editExternalLink(fileId, linkId, access, primary, internal) {
return request({
method: "put",
url: `/files/file/${fileId}/links`,
data: {
linkId,
access,
primary,
internal,
},
data: { linkId, access, primary, internal },
});
}
export function addExternalLink(fileId, access, primary, internal) {
return request({
method: "put",
url: `/files/file/${fileId}/links`,
data: { access, primary, internal },
});
}

View File

@ -10,6 +10,7 @@ import {
getPrimaryLink,
getExternalLinks,
editExternalLink,
addExternalLink,
} from "../api/files";
const observedKeys = [
@ -362,7 +363,7 @@ class InfoPanelStore {
return res;
};
getAdditionalFileLinks = async (fileId) => {
getFileLinks = async (fileId) => {
const res = await getExternalLinks(fileId);
return res;
};
@ -375,7 +376,11 @@ class InfoPanelStore {
primary,
internal
);
console.log(res);
return res;
};
addFileLink = async (fileId, access, primary, internal) => {
const res = await addExternalLink(fileId, access, primary, internal);
return res;
};
}