create-group

This commit is contained in:
antelle 2021-04-12 23:23:22 +02:00
parent b9e08cd9e3
commit 5397fa8fd3
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
1 changed files with 25 additions and 1 deletions

View File

@ -338,10 +338,34 @@ const ProtocolHandlers = {
},
async 'create-new-group'(request) {
decryptRequest(request);
const payload = decryptRequest(request);
await checkContentRequestPermissions(request);
if (!payload.groupName) {
throw new Error('No groupName');
}
// TODO: show file selector
// throw makeError(Errors.userRejected);
const groupNames = payload.groupName
.split('/')
.map((g) => g.trim())
.filter((g) => g);
if (!groupNames.length) {
throw new Error('Empty group path');
}
// TODO: create a new group
throw new Error('Not implemented');
// return encryptResponse(request, {
// success: 'true',
// version: getVersion(request),
// name: groupNames[groupNames.length - 1],
// uuid: kdbxweb.ByteUtils.bytesToHex(appModel.files[0].groups[0].group.uuid.bytes)
// });
}
};