mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
fix
This commit is contained in:
@@ -11,6 +11,8 @@ export class PublicationFolderService {
|
||||
publicationList: {[key: string]: Publication[] } = {};
|
||||
FolderDetails: {[key: string]: PublicationFolder } = {};
|
||||
|
||||
restoreFolder: {} = {}
|
||||
|
||||
keyName: string
|
||||
|
||||
constructor(
|
||||
@@ -18,21 +20,29 @@ export class PublicationFolderService {
|
||||
) {}
|
||||
|
||||
|
||||
getFromDB(folderId: any) {
|
||||
|
||||
createPublicationList(folderId) {
|
||||
if(!this.publicationList[folderId]) {
|
||||
this.publicationList[folderId] = []
|
||||
}
|
||||
if(!this.FolderDetails[folderId]) {
|
||||
this.FolderDetails[folderId] = new PublicationFolder();
|
||||
}
|
||||
}
|
||||
|
||||
this.storage.get(folderId).then((viewPublications) => {
|
||||
this.publicationList[folderId] = viewPublications
|
||||
})
|
||||
this.storage.get(folderId+"name").then((viewPublications) => {
|
||||
this.FolderDetails[folderId] = viewPublications
|
||||
})
|
||||
getFromDB(folderId: any) {
|
||||
|
||||
if(!this.restoreFolder[folderId]) {
|
||||
|
||||
this.storage.get(folderId).then((viewPublications) => {
|
||||
this.publicationList[folderId] = viewPublications
|
||||
})
|
||||
|
||||
this.storage.get(folderId+"name").then((viewPublications) => {
|
||||
this.FolderDetails[folderId] = viewPublications
|
||||
})
|
||||
}
|
||||
|
||||
this.restoreFolder[folderId] = true
|
||||
}
|
||||
|
||||
updateFolderDetails(folderId, res) {
|
||||
@@ -68,15 +78,16 @@ export class PublicationFolderService {
|
||||
}
|
||||
}
|
||||
|
||||
deletePost(publicationId: any, folderId) {
|
||||
|
||||
for (let i = 0; i <= this.publicationList[folderId].length; i++) {
|
||||
if(this.publicationList[folderId][i].DocumentId == publicationId) {
|
||||
this.publicationList[folderId].splice(i, 1)
|
||||
}
|
||||
}
|
||||
deletePost(folderId: any, publicationId: any) {
|
||||
|
||||
if(this.publicationList[folderId]) {
|
||||
|
||||
this.publicationList[folderId] = this.publicationList[folderId].filter( e => e.DocumentId != publicationId)
|
||||
|
||||
this.save(folderId)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user