mirror of
https://github.com/bitwarden/browser.git
synced 2024-09-14 02:08:50 +02:00
return id when creating
This commit is contained in:
parent
8e23842399
commit
1aa937724e
@ -4,6 +4,7 @@ import { CipherService } from 'jslib/abstractions/cipher.service';
|
|||||||
import { FolderService } from 'jslib/services/folder.service';
|
import { FolderService } from 'jslib/services/folder.service';
|
||||||
|
|
||||||
import { Response } from '../models/response';
|
import { Response } from '../models/response';
|
||||||
|
import { StringResponse } from '../models/response/stringResponse';
|
||||||
|
|
||||||
import { Cipher } from '../models/cipher';
|
import { Cipher } from '../models/cipher';
|
||||||
import { Folder } from '../models/folder';
|
import { Folder } from '../models/folder';
|
||||||
@ -34,7 +35,7 @@ export class CreateCommand {
|
|||||||
const cipher = await this.cipherService.encrypt(Cipher.toView(req));
|
const cipher = await this.cipherService.encrypt(Cipher.toView(req));
|
||||||
try {
|
try {
|
||||||
await this.cipherService.saveWithServer(cipher);
|
await this.cipherService.saveWithServer(cipher);
|
||||||
return Response.success();
|
return Response.success(new StringResponse(cipher.id));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return Response.error(e);
|
return Response.error(e);
|
||||||
}
|
}
|
||||||
@ -44,7 +45,7 @@ export class CreateCommand {
|
|||||||
const folder = await this.folderService.encrypt(Folder.toView(req));
|
const folder = await this.folderService.encrypt(Folder.toView(req));
|
||||||
try {
|
try {
|
||||||
await this.folderService.saveWithServer(folder);
|
await this.folderService.saveWithServer(folder);
|
||||||
return Response.success();
|
return Response.success(new StringResponse(folder.id));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return Response.error(e);
|
return Response.error(e);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user