1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00
Files
browser/libs/common/src/models/export/folder-with-id.export.ts
aj-rosado c6bc97cf5c [PS-2390] Passing folder and collection id on import (#4802)
* 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
2023-04-05 19:15:33 +01:00

25 lines
723 B
TypeScript

import { Folder as FolderDomain } from "../../vault/models/domain/folder";
import { FolderView } from "../../vault/models/view/folder.view";
import { FolderExport } from "./folder.export";
export class FolderWithIdExport extends FolderExport {
id: string;
static toView(req: FolderWithIdExport, view = new FolderView()) {
view.id = req.id;
return super.toView(req, view);
}
static toDomain(req: FolderWithIdExport, domain = new FolderDomain()) {
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: FolderView | FolderDomain) {
this.id = o.id;
super.build(o);
}
}