Add functionality to add a new share by map

This commit is contained in:
Max Berger
2026-03-07 23:18:31 +01:00
parent 8393099b05
commit 25e571ad63
7 changed files with 158 additions and 15 deletions

View File

@@ -519,6 +519,54 @@ export function add_share_by_token(
);
}
/**
* @param {string} user
* @param {string} password
* @param {string} pathMapped
* @param {string} permissions
* @param {boolean} enabled
* @param {boolean} hidden
* @param {string} properties
* @param {string} share_user
* @param {string} href
* @param {function():void} callback
*/
export function add_share_by_map(
user,
password,
pathMapped,
permissions,
enabled,
hidden,
properties,
share_user,
href,
callback,
) {
call_sharing_api(
user,
password,
"map/create",
{
PathMapped: pathMapped,
Permissions: permissions,
Enabled: enabled,
Hidden: hidden,
Properties: properties,
User: share_user,
PathOrToken: "/" + share_user + "/" + href,
},
function (response) {
let json_response = JSON.parse(response);
if (json_response["Status"] !== "success") {
console.error("Failed to create share map: " + (json_response["Status"] || "Unknown error"));
} else {
callback();
}
},
);
}
/**
* @param {string} user
* @param {string} password