add search

This commit is contained in:
Peter Maquiran
2021-08-10 16:24:14 +01:00
parent 1cc3b41227
commit dcbe98df94
8 changed files with 93 additions and 17 deletions
+39
View File
@@ -0,0 +1,39 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'searchDocument'
})
export class SearchDocumentPipe implements PipeTransform {
transform(document): unknown {
return null;
}
transformToAttachment(document): unknown {
const attachments = []
if(document.Documents) {
document.Documents.forEach( (ele) => {
console.log(ele)
attachments.push({
ApplicationId: 361,
Source: 1,
SourceId: ele.docID || ele.docId || ele.DocId,
SourceName: ele.Assunto
})
});
} else {
attachments.push({
ApplicationId: 8,
Source: 1,
SourceId: document.docID || document.docId || document.DocId,
SourceName: document.Assunto
})
}
return attachments;
}
}