mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
add search
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user