2021-08-10 16:24:14 +01:00
|
|
|
import { Pipe, PipeTransform } from '@angular/core';
|
2021-08-20 12:02:27 +01:00
|
|
|
import { Attachments, SearchList } from '../models/search-document';
|
2021-08-10 16:24:14 +01:00
|
|
|
|
|
|
|
|
@Pipe({
|
|
|
|
|
name: 'searchDocument'
|
|
|
|
|
})
|
|
|
|
|
export class SearchDocumentPipe implements PipeTransform {
|
|
|
|
|
|
|
|
|
|
transform(document): unknown {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-20 12:02:27 +01:00
|
|
|
transformToAttachment(document: SearchList): Attachments[] {
|
2021-08-10 16:24:14 +01:00
|
|
|
const attachments = []
|
|
|
|
|
|
2021-08-13 16:07:17 +01:00
|
|
|
if(document.ApplicationType == 361) {
|
|
|
|
|
attachments.push({
|
|
|
|
|
ApplicationId: 361,
|
|
|
|
|
Source: 1,
|
|
|
|
|
SourceId: document['docID'] || document['docId'] || document['DocId'] || document.Id,
|
2021-08-13 16:12:45 +01:00
|
|
|
SourceName: document.Assunto,
|
|
|
|
|
SourceType: 'FOLDER'
|
2021-08-13 16:07:17 +01:00
|
|
|
})
|
|
|
|
|
} else if (document.ApplicationType == 8) {
|
2021-08-10 16:24:14 +01:00
|
|
|
attachments.push({
|
|
|
|
|
ApplicationId: 8,
|
|
|
|
|
Source: 1,
|
2021-08-13 16:07:17 +01:00
|
|
|
SourceId: document['docID'] || document['docId'] || document['DocId'] || document.Id,
|
2021-08-13 16:12:45 +01:00
|
|
|
SourceName: document.Assunto,
|
|
|
|
|
SourceType: 'WEBTRIX'
|
2021-08-10 16:24:14 +01:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return attachments;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|