|
|
|
@ -109,7 +109,17 @@ class AppsDatabase extends DatabaseHandler {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return this.db.put(data)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
.then(async (response) => {
|
|
|
|
|
|
|
|
|
|
const tagsDatabase = new TagsDatabase()
|
|
|
|
|
|
|
|
|
|
// if tags are in data update tags also in database
|
|
|
|
|
if (data.tags && data.tags.length > 0) {
|
|
|
|
|
tagsDatabase.update(data.tags)
|
|
|
|
|
} else {
|
|
|
|
|
await tagsDatabase.removeNotNeeded()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return this.findOneById(response._id)
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
|
@ -251,7 +261,6 @@ class AppsDatabase extends DatabaseHandler {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return this.db.find(query).then(async (documents) => {
|
|
|
|
|
console.log(documents.docs)
|
|
|
|
|
return documents.docs
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
|
|