mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
38 lines
976 B
TypeScript
38 lines
976 B
TypeScript
import { Pipe, PipeTransform } from '@angular/core';
|
|
import { Attachments, SearchList } from '../models/search-document';
|
|
|
|
@Pipe({
|
|
name: 'searchDocument'
|
|
})
|
|
export class SearchDocumentPipe implements PipeTransform {
|
|
|
|
transform(document): unknown {
|
|
return null;
|
|
}
|
|
|
|
transformToAttachment(document: SearchList): Attachments[] {
|
|
const attachments = []
|
|
|
|
if(document.ApplicationType == 361) {
|
|
attachments.push({
|
|
ApplicationId: 361,
|
|
Source: 1,
|
|
SourceId: document['docID'] || document['docId'] || document['DocId'] || document.Id,
|
|
SourceName: document.Assunto,
|
|
SourceType: 'FOLDER'
|
|
})
|
|
} else if (document.ApplicationType == 8) {
|
|
attachments.push({
|
|
ApplicationId: 8,
|
|
Source: 1,
|
|
SourceId: document['docID'] || document['docId'] || document['DocId'] || document.Id,
|
|
SourceName: document.Assunto,
|
|
SourceType: 'WEBTRIX'
|
|
})
|
|
}
|
|
|
|
return attachments;
|
|
}
|
|
|
|
}
|