mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
change api source for mobile
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { HttpClient, HttpHeaderResponse, HttpHeaders } from '@angular/common/http';
|
||||
import { HttpClient, HttpErrorResponse, HttpHeaderResponse, HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ok, err } from 'neverthrow';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
@@ -9,16 +10,19 @@ export class HttpService {
|
||||
|
||||
constructor(private http:HttpClient) { }
|
||||
|
||||
post(serviceName:string, data:any){
|
||||
const headers = new HttpHeaders();;
|
||||
const options = {header: headers, withCredentials: false};
|
||||
async post(serviceName:string, data:any) {
|
||||
const headers = new HttpHeaders();
|
||||
const url = environment.apiChatUrl+serviceName;
|
||||
const body = {"user": "admin","password": "tabteste@006"};
|
||||
|
||||
return this.http.post(url, /* JSON.stringify( */data/* ), options */)
|
||||
try {
|
||||
const result = await this.http.post(url, {}).toPromise()
|
||||
return ok (result)
|
||||
} catch (e) {
|
||||
return err(e as HttpErrorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
get(serviceName:string, options:any){
|
||||
async get(serviceName:string, options:any) {
|
||||
const url = environment.apiChatUrl+serviceName;
|
||||
return this.http.get(url, options);
|
||||
}
|
||||
|
||||
@@ -83,21 +83,21 @@ export class ProcessesService {
|
||||
return this.http.get<fullTaskList[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
eventsToApprove(userid, caller) {
|
||||
const geturl = environment.apiURL + 'tasks/events-to-approve';
|
||||
let params = new HttpParams();
|
||||
// eventsToApprove(userid, caller) {
|
||||
// const geturl = environment.apiURL + 'tasks/events-to-approve';
|
||||
// let params = new HttpParams();
|
||||
|
||||
params = params.set("pageNum", 1);
|
||||
params = params.set("pageSize", 500);
|
||||
params = params.set("userid", userid);
|
||||
// params = params.set("pageNum", 1);
|
||||
// params = params.set("pageSize", 500);
|
||||
// params = params.set("userid", userid);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
// let options = {
|
||||
// headers: this.headers,
|
||||
// params: params
|
||||
// };
|
||||
|
||||
return this.http.get<fullTaskList[]>(`${geturl}`, options);
|
||||
}
|
||||
// return this.http.get<fullTaskList[]>(`${geturl}`, options);
|
||||
// }
|
||||
|
||||
GetTaskListExpediente(onlycount1): Observable<ExpedienteFullTask[]> {
|
||||
const processname = "Expediente"
|
||||
|
||||
Reference in New Issue
Block a user