mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
* PS-2390 - Passing folder and collection id on import Reading groupingid from lastpass csv as collection or folder id * PS-2390 - Added toDomain and toModel on FolderWithIdExport model and created CollectionWithIdExport model * PS-2390 - renamed groupingid into bwcollectionid on lastpass importer * PS-2390 - Updated collection/folder-with-id export to reuse parent toDomain and toView * PS-2390 Undo the lastpass importer groupingId rename * PS-2390 Undo lastpass importer changes * PS-2390 - Removed externalId set. Cleaning collection-with-id-request to user parent properties * Lint prettier
25 lines
799 B
TypeScript
25 lines
799 B
TypeScript
import { Collection as CollectionDomain } from "../../admin-console/models/domain/collection";
|
|
import { CollectionView } from "../../admin-console/models/view/collection.view";
|
|
|
|
import { CollectionExport } from "./collection.export";
|
|
|
|
export class CollectionWithIdExport extends CollectionExport {
|
|
id: string;
|
|
|
|
static toView(req: CollectionWithIdExport, view = new CollectionView()) {
|
|
view.id = req.id;
|
|
return super.toView(req, view);
|
|
}
|
|
|
|
static toDomain(req: CollectionWithIdExport, domain = new CollectionDomain()) {
|
|
domain.id = req.id;
|
|
return super.toDomain(req, domain);
|
|
}
|
|
|
|
// Use build method instead of ctor so that we can control order of JSON stringify for pretty print
|
|
build(o: CollectionView | CollectionDomain) {
|
|
this.id = o.id;
|
|
super.build(o);
|
|
}
|
|
}
|