Skip to content
Snippets Groups Projects
Commit 6c9a5720 authored by paflov's avatar paflov
Browse files

implement [POST] /test/{test_id}/lock endpoint

parent d1f4feb1
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,8 @@ export class BackendService { ...@@ -13,6 +13,8 @@ export class BackendService {
private serverSlimAdminUrl = ''; private serverSlimAdminUrl = '';
private serverSlimUrl_Close = ''; private serverSlimUrl_Close = '';
private serverUrl2 = 'http://localhost/testcenter-iqb-php/'; // TODO (BEFORE-MERGE) REMOVE
constructor( constructor(
@Inject('SERVER_URL') private readonly serverUrl: string, @Inject('SERVER_URL') private readonly serverUrl: string,
private http: HttpClient) { private http: HttpClient) {
...@@ -103,12 +105,11 @@ export class BackendService { ...@@ -103,12 +105,11 @@ export class BackendService {
); );
} }
// BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
lockBooklet(bookletDbId: number): Observable<boolean | ServerError> { lockBooklet(testId: number): Observable<boolean | ServerError> {
return this.http return this.http
.post<boolean>(this.serverSlimUrl_Close + 'lock', {b: bookletDbId}) .post<boolean>(this.serverUrl2 + `test/${testId}/lock`, {})
.pipe( .pipe(catchError(ErrorHandler.handle));
catchError(ErrorHandler.handle)
);
} }
} }
...@@ -10,19 +10,13 @@ import { ServerError } from 'iqb-components'; ...@@ -10,19 +10,13 @@ import { ServerError } from 'iqb-components';
providedIn: 'root' providedIn: 'root'
}) })
export class BackendService { export class BackendService {
private serverSlimUrl_GET = '';
private serverSlimUrl_POST = '';
private serverUrl2 = 'http://localhost/testcenter-iqb-php/'; private serverUrl2 = 'http://localhost/testcenter-iqb-php/'; // TODO (BEFORE-MERGE) REMOVE
constructor( constructor(
@Inject('SERVER_URL') private serverUrl: string, @Inject('SERVER_URL') private serverUrl: string,
private http: HttpClient private http: HttpClient
) { ) {
this.serverSlimUrl_GET = this.serverUrl + 'php_tc/tc_get.php/';
this.serverSlimUrl_POST = this.serverUrl + 'php_tc/tc_post.php/';
this.serverUrl = this.serverUrl + 'php_tc/';
} }
......
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