folder and collection templates
This commit is contained in:
parent
1aa937724e
commit
9ce758e859
|
@ -16,7 +16,9 @@ import { TemplateResponse } from '../models/response/templateResponse';
|
||||||
|
|
||||||
import { Card } from '../models/card';
|
import { Card } from '../models/card';
|
||||||
import { Cipher } from '../models/cipher';
|
import { Cipher } from '../models/cipher';
|
||||||
|
import { Collection } from '../models/collection';
|
||||||
import { Field } from '../models/field';
|
import { Field } from '../models/field';
|
||||||
|
import { Folder } from '../models/folder';
|
||||||
import { Identity } from '../models/identity';
|
import { Identity } from '../models/identity';
|
||||||
import { Login } from '../models/login';
|
import { Login } from '../models/login';
|
||||||
import { LoginUri } from '../models/loginUri';
|
import { LoginUri } from '../models/loginUri';
|
||||||
|
@ -124,6 +126,12 @@ export class GetCommand {
|
||||||
case 'securenote':
|
case 'securenote':
|
||||||
template = SecureNote.template();
|
template = SecureNote.template();
|
||||||
break;
|
break;
|
||||||
|
case 'folder':
|
||||||
|
template = Folder.template();
|
||||||
|
break;
|
||||||
|
case 'collection':
|
||||||
|
template = Collection.template();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return Response.badRequest('Unknown template object.');
|
return Response.badRequest('Unknown template object.');
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
import { CollectionView } from 'jslib/models/view/collectionView';
|
import { CollectionView } from 'jslib/models/view/collectionView';
|
||||||
|
|
||||||
export class Collection {
|
export class Collection {
|
||||||
|
static template(): Collection {
|
||||||
|
const req = new Collection();
|
||||||
|
req.organizationId = '00000000-0000-0000-0000-000000000000';
|
||||||
|
req.name = 'Collection name';
|
||||||
|
return req;
|
||||||
|
}
|
||||||
|
|
||||||
static toView(req: Collection, view = new CollectionView()) {
|
static toView(req: Collection, view = new CollectionView()) {
|
||||||
view.name = req.name;
|
view.name = req.name;
|
||||||
if (view.organizationId == null) {
|
if (view.organizationId == null) {
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
import { FolderView } from 'jslib/models/view/folderView';
|
import { FolderView } from 'jslib/models/view/folderView';
|
||||||
|
|
||||||
export class Folder {
|
export class Folder {
|
||||||
|
static template(): Folder {
|
||||||
|
const req = new Folder();
|
||||||
|
req.name = 'Folder name';
|
||||||
|
return req;
|
||||||
|
}
|
||||||
|
|
||||||
static toView(req: Folder, view = new FolderView()) {
|
static toView(req: Folder, view = new FolderView()) {
|
||||||
view.name = req.name;
|
view.name = req.name;
|
||||||
return view;
|
return view;
|
||||||
|
|
Loading…
Reference in New Issue