improve edition of draft

This commit is contained in:
Eudes Inácio
2023-07-10 12:38:41 +01:00
parent 9676bab7eb
commit c69ea92c91
11 changed files with 124 additions and 33 deletions
+22 -2
View File
@@ -11,6 +11,7 @@ import { fullTaskList } from '../models/dailyworktask.model';
import { ChangeProfileService } from './change-profile.service';
import { SessionStore } from '../store/session.service';
import { StorageService } from './storage.service';
import { DocumentManagementStore } from '../store/documentManagement';
@Injectable({
providedIn: 'root'
})
@@ -20,12 +21,14 @@ export class ProcessesService {
loggeduser: LoginUserRespose;
headers: HttpHeaders;
headers2: HttpHeaders;
documentMangement = DocumentManagementStore;
constructor(
private http: HttpClient,
private changeProfileService: ChangeProfileService,
private storageSevice: StorageService
private storageSevice: StorageService,
) {
this.loggeduser = SessionStore.user;
@@ -42,12 +45,13 @@ export class ProcessesService {
setHeader() {
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
this.headers2 = new HttpHeaders();
this.headers2 = this.headers2.set('Authorization',"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIyNjIiLCJ1bmlxdWVfbmFtZSI6IkdpbHNvbiBNYW51ZWwiLCJlbWFpbCI6ImdpbHNvbi5tYW51ZWxAZ2FiaW5ldGVkaWdpdGFsLmxvY2FsIiwicm9sZSI6IlNlY3JldMOhcmlvIEdlcmFsIiwiZ3JvdXBzaWQiOiJHYWJpbmV0ZSBkZSBUZWNub2xvZ2lhcyBkZSBJbmZvcm1hw6fDo28iLCJvcmdhbmljZW50aXR5aWREIjoiMTA2IiwibmJmIjoxNjg4NTg0NTYzLCJleHAiOjE3MjAxMjA1NjMsImlhdCI6MTY4ODU4NDU2MywiaXNzIjoiOGIxMzBhN2YwLWM3YjctNDdzMjMtOWE4ZC1kNTlhMDE5YWY3NDkiLCJhdWQiOiJkMjh3dzE0NTMtM2M2OC00MWFkLThiNmMtYTUzNDUzODNlMGMyIn0.QDCrQsCH59GQMoudZTHyCMwwHYVwz1mZkLTzvzAwh64"
this.headers2 = this.headers2.set('Authorization',"Bearer "+ this.documentMangement.session?.AuthorizationJwt
);
}
@@ -132,6 +136,9 @@ export class ProcessesService {
}
GetDraftByID(id:string): Observable<any> {
console.log('Instancia estas instanciar?',this.documentMangement.session?.AuthorizationJwt)
const geturl = environment.apiPCURL + `Documents/${id}`;
let params = new HttpParams();
@@ -144,6 +151,19 @@ export class ProcessesService {
return this.http.get<any>(`${geturl}`, options);
}
SaveDraftByID(id:string, object): Observable<any> {
const geturl = environment.apiPCURL + `Documents/${id}`;
let params = new HttpParams();
/* params = params.set("serialNumber", serialnumber); */
let options = {
headers: this.headers2,
/* params: params */
};
return this.http.put<any>(`${geturl}`, object, options);
}
SetTaskToPending(serialNumber:string): Observable<any>{
const geturl = environment.apiURL + 'Tasks/SetTaskPending';
let params = new HttpParams();