Skip to content
Snippets Groups Projects
Commit 0c69d781 authored by paflov's avatar paflov
Browse files

implement [PUT] /test endpoint

parent 4381dd5a
No related branches found
No related tags found
No related merge requests found
import { Injectable, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import {HttpClient, HttpParams} from '@angular/common/http';
import { Observable, of } from 'rxjs';
import {catchError, switchMap} from 'rxjs/operators';
import { LoginData, BookletStatus, PersonTokenAndTestId, KeyValuePair } from './app.interfaces';
......@@ -74,17 +74,14 @@ export class BackendService {
);
}
// BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
getBookletStatus(bookletid: string, code = ''): Observable<BookletStatus | ServerError> {
let urlString = '?b=' + bookletid;
if (code.length > 0) {
urlString += '&c=' + code;
}
return this.http.get<BookletStatus>(this.serverSlimUrl + 'bookletstatus' + urlString)
.pipe(
catchError(ErrorHandler.handle)
);
getBookletState(bookletName: string, code = ''): Observable<BookletStatus | ServerError> {
const params = new HttpParams().set('code', code);
return this.http
.get<BookletStatus>(this.serverUrl2 + `booklet/${bookletName}/state`, {params})
.pipe(catchError(ErrorHandler.handle));
}
......
......@@ -24,7 +24,7 @@ export class StartButtonData {
}
public getBookletStatus(bs: BackendService, code = '') {
return bs.getBookletStatus(this.id, code)
return bs.getBookletState(this.id, code)
.pipe(
map(respDataUntyped => {
let myreturn = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment