Add flag to always allow share by link
This commit is contained in:
@@ -114,7 +114,7 @@ export class DriveApiClient {
|
||||
);
|
||||
}
|
||||
|
||||
static async update(companyId: string, id: string, update: Partial<DriveItem>) {
|
||||
static async update(companyId: string, id: string, update: Partial<DriveItem> & { is_update_access_to_share_link?: boolean }) {
|
||||
return await Api.post<Partial<DriveItem>, DriveItem>(
|
||||
`/internal/services/documents/v1/companies/${companyId}/item/${id}${appendTdriveToken()}`,
|
||||
update,
|
||||
|
||||
@@ -235,7 +235,7 @@ export const useDriveActions = (inPublicSharing?: boolean) => {
|
||||
);
|
||||
|
||||
const update = useCallback(
|
||||
async (update: Partial<DriveItem>, id: string, parentId: string, previousName?: string) => {
|
||||
async (update: Partial<DriveItem> & { is_update_access_to_share_link?: boolean }, id: string, parentId: string, previousName?: string) => {
|
||||
try {
|
||||
const newItem = await DriveApiClient.update(companyId, id, update);
|
||||
if (previousName && previousName !== newItem.name && !update.name)
|
||||
|
||||
@@ -65,7 +65,7 @@ export const useDriveItem = (id: string) => {
|
||||
}, [id, setLoading, refresh, item?.item?.parent_id]);
|
||||
|
||||
const update = useCallback(
|
||||
async (update: Partial<DriveItem>, skipLoading = false) => {
|
||||
async (update: Partial<DriveItem> & { is_update_access_to_share_link?: boolean }, skipLoading = false) => {
|
||||
if (!skipLoading) setLoading(true);
|
||||
try {
|
||||
await _update(update, id, item?.item?.parent_id || '');
|
||||
|
||||
@@ -140,7 +140,10 @@ const PublicLinkModalContent = (props: {
|
||||
disabled={loading}
|
||||
level={item?.access_info?.public?.level || 'none'}
|
||||
onChange={level => {
|
||||
item && update(changePublicLink(item, { level }));
|
||||
item && update({
|
||||
...changePublicLink(item, { level }),
|
||||
is_update_access_to_share_link: true,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<SwitchToAdvancedSettingsRow
|
||||
|
||||
Reference in New Issue
Block a user