cloud fixes

This commit is contained in:
SPRINX0\prochazka
2025-05-26 12:06:33 +02:00
parent 716c3573fd
commit 98e4fabd2e
3 changed files with 51 additions and 8 deletions

View File

@@ -70,7 +70,10 @@ module.exports = {
grantFolder_meta: true,
async grantFolder({ inviteLink }) {
const m = inviteLink.match(/^dbgate\:\/\/folder\/v1\/([a-zA-Z]+)\?mode=(read|write|admin)$/);
const m = inviteLink.match(/^dbgate\:\/\/folder\/v1\/([a-zA-Z0-9]+)\?mode=(read|write|admin)$/);
if (!m) {
throw new Error('Invalid invite link format');
}
const invite = m[1];
const mode = m[2];
@@ -93,6 +96,12 @@ module.exports = {
return resp;
},
getInviteToken_meta: true,
async getInviteToken({ folid, role }) {
const resp = await callCloudApiGet(`invite-token/${folid}/${role}`);
return resp;
},
refreshContent_meta: true,
async refreshContent() {
socket.emitChanged('cloud-content-changed');