2025-09-11 11:20:44 +01:00
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
|
import { PublicationFileGetByDocumentIdInput, PublicationFileGetByDocumentIdOutPut } from 'src/app/core/actions/use-case/publication-file-get-by-document-id.service';
|
|
|
|
|
import { PublicationListByProcessIdOutPut } from 'src/app/core/actions/use-case/publication-list-by-process-id.service';
|
|
|
|
|
import { ApiResponse } from 'src/app/infra/http/type';
|
|
|
|
|
import { HttpService } from 'src/app/services/http.service';
|
|
|
|
|
import { environment } from 'src/environments/environment';
|
2026-03-18 14:37:45 +01:00
|
|
|
import { HttpService as HttpServiceInfra } from 'src/app/infra/http/http.service';
|
2025-09-11 11:20:44 +01:00
|
|
|
|
|
|
|
|
@Injectable({
|
|
|
|
|
providedIn: 'root'
|
|
|
|
|
})
|
|
|
|
|
export class PublicationFileRemoteRepositoryService {
|
|
|
|
|
|
|
|
|
|
private baseUrl = `${environment.apiURLStage.slice(0, -1)}/PresidentialActions`; // Your base URL
|
|
|
|
|
|
|
|
|
|
constructor(
|
2026-03-18 14:37:45 +01:00
|
|
|
private http: HttpService,
|
|
|
|
|
private httpServiceInfra: HttpServiceInfra,
|
|
|
|
|
|
2025-09-11 11:20:44 +01:00
|
|
|
) { }
|
|
|
|
|
|
|
|
|
|
async listByProcessId(processId: string) {
|
|
|
|
|
console.log(this.baseUrl);
|
|
|
|
|
return await this.http.get<ApiResponse<PublicationListByProcessIdOutPut>>(`${this.baseUrl}/${processId}/Posts`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async FileListByDocumentId(input: PublicationFileGetByDocumentIdInput) {
|
2026-03-18 14:37:45 +01:00
|
|
|
return await this.httpServiceInfra.get<ApiResponse<PublicationFileGetByDocumentIdOutPut>>(`${this.baseUrl}/Posts/${input.documentId}/file`);
|
2025-09-11 11:20:44 +01:00
|
|
|
}
|
|
|
|
|
}
|