Fix incorrect loading of enhanced models

Signed-off-by: Marius David Wieschollek's avatarMarius David Wieschollek <passwords.public@mdns.eu>
parent 6b3b25cc
......@@ -11,9 +11,9 @@ export default class EnhancedClassLoader extends DefaultClassLoader {
*/
_getDefaultClasses() {
let classes = super._getDefaultClasses();
classes.model.password = EnhancedPassword;
classes.model.folder = EnhancedFolder;
classes.model.tag = EnhancedTag;
classes.model.password = (d) => { return new EnhancedPassword(d, this.getInstance('api')); };
classes.model.folder = (d) => { return new EnhancedFolder(d, this.getInstance('api')); };
classes.model.tag = (d) => { return new EnhancedTag(d, this.getInstance('api')); };
return classes;
}
......
......@@ -22,7 +22,7 @@ export default class EnhancedFolder extends Folder {
/**
*
* @returns {Promise<FolderCollection[]>}
* @returns {Promise<FolderCollection>}
*/
async fetchRevisions() {
if(this.getProperty('revisions') === undefined) {
......@@ -34,7 +34,7 @@ export default class EnhancedFolder extends Folder {
/**
*
* @returns {Promise<PasswordCollection[]>}
* @returns {Promise<PasswordCollection>}
*/
async fetchPasswords() {
if(this.getProperty('passwords') === undefined) {
......@@ -46,7 +46,7 @@ export default class EnhancedFolder extends Folder {
/**
*
* @returns {Promise<FolderCollection[]>}
* @returns {Promise<FolderCollection>}
*/
async fetchFolders() {
if(this.getProperty('folders') === undefined) {
......@@ -58,7 +58,7 @@ export default class EnhancedFolder extends Folder {
/**
*
* @returns {Promise<Folder[]>}
* @returns {Promise<Folder>}
*/
async fetchParent() {
if(this.getProperty('parent') === undefined) {
......
......@@ -63,35 +63,35 @@ export default class EnhancedPassword extends Password {
/**
*
* @returns {Promise<Password[]>}
* @returns {Promise<PasswordCollection>}
*/
async fetchRevisions() {
}
/**
*
* @returns {Promise<Share[]>}
* @returns {Promise<Share>}
*/
async fetchShare() {
}
/**
*
* @returns {Promise<Share[]>}
* @returns {Promise<ShareCollection>}
*/
async fetchShares() {
}
/**
*
* @returns {Promise<Tag[]>}
* @returns {Promise<TagCollection>}
*/
async fetchTags() {
}
/**
*
* @returns {Promise<Folder[]>}
* @returns {Promise<FolderCollection>}
*/
async fetchFolder() {
}
......
......@@ -22,7 +22,7 @@ export default class EnhancedTag extends Tag {
/**
*
* @returns {Promise<Tag[]>}
* @returns {Promise<TagCollection>}
*/
async fetchRevisions() {
......@@ -30,7 +30,7 @@ export default class EnhancedTag extends Tag {
/**
*
* @returns {Promise<Password[]>}
* @returns {Promise<PasswordCollection>}
*/
async fetchPasswords() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment