Commit 71784dc4 authored by Open Source Developer's avatar Open Source Developer

a

parent 2cc27bf9
......@@ -2,7 +2,7 @@ export class AppSettings {
public static get API_ENDPOINT(): string {
return 'http://localhost/angular/eepal-front/drupal';
/ return 'http://localhost/drupal-8.2.5';
// return 'http://localhost/drupal-8.2.5';
// return 'http://eepal.dev/drupal';
// return 'http://eduslim2.minedu.gov.gr/drupal';
}
......
......@@ -7,7 +7,6 @@ import { NgRedux, select } from 'ng2-redux';
import { IAmkaFills } from '../../store/amkafill/amkafills.types';
import { IAppState } from '../../store/store';
import { AmkaCheckService} from '../../services/amkacheck-service';
import {
FormBuilder,
FormGroup,
......@@ -33,7 +32,6 @@ import {AppSettings} from '../../app.settings';
</button>
</div>
</div>
</form>
`
})
......@@ -73,9 +71,6 @@ import {AppSettings} from '../../app.settings';
saveSelected() {
this._cas.checkstudentamka(this.formGroup.value)
.subscribe(res =>this.respond = res);
console.log(this.respond);
this._cfa.saveAmkaFills(this.formGroup.value);
this.router.navigate(['/epal-class-select']);
}
......
......@@ -38,6 +38,10 @@ import {AppSettings} from '../../app.settings';
</div>
</div>
<div *ngIf="emptyselection==true">
Παρακαλώ επιλέξτε μια τάξη
</div>
</form>
`
})
......@@ -47,7 +51,7 @@ import {AppSettings} from '../../app.settings';
public formGroup: FormGroup;
emptyselection = false;
constructor(private fb: FormBuilder,
private _cfa: EpalClassesActions,
private _ngRedux: NgRedux<IAppState>,
......@@ -59,8 +63,6 @@ import {AppSettings} from '../../app.settings';
ngOnInit() {
// this._cfa.getEpalClasses()
this.epalclasses$ = this._ngRedux.select(state => {
if (state.epalclasses.size > 0) {
state.epalclasses.reduce(({}, epalclass) => {
......@@ -74,9 +76,16 @@ import {AppSettings} from '../../app.settings';
}
saveSelected() {
if (this.formGroup.value.name == undefined) {
this.emptyselection = true;
}
else
{
this._cfa.saveEpalClassesSelected(this.formGroup.value);
this.router.navigate(['/region-schools-select']);
}
}
}
......@@ -15,4 +15,6 @@ export const STUDENTDATAFIELDS_SAVE = 'STUDENTDATAFIELDS_SAVE';
export const EPALCLASSES_SAVE = 'EPALCLASSES_SAVE';
export const AMKAFILL_SAVE = 'AMKAFILL_SAVE';
export const VALID_NAMES_PATTERN = '[Α-ΩΆΈΉΊΎΌΏα-ωάέήίύόώ ]*$';
......@@ -2,16 +2,16 @@ import {Http,Response, RequestOptions, Headers} from '@angular/http';
import {Injectable} from '@angular/core';
import {Observable} from "rxjs/Observable";
import 'rxjs/add/operator/map';
import { IAmkaFill } from '../store/amkafill/amkafills.types';
@Injectable()
export class AmkaCheckService {
private _url = "https://wso2.minedu.gov.gr/amka/v1.1/" ;
private respond :Object
constructor(private _http: Http) {
};
checkstudentamka(amka: any) {
let authToken = '7bed3fc5-f9f5-3613-abcd-3b08bab0f625';
let headers = new Headers({ 'Accept': 'application/json' });
headers.append('Authorization', `Bearer ${authToken}`);
......@@ -20,8 +20,10 @@ export class AmkaCheckService {
let parameter1 = 'ksdhkshf' ;
return this._http.get(this._url+ amka.name +'/'+ parameter1 ,options)
.map(response => response.json() );
this._http.get(this._url+ amka.name +'/'+ parameter1 ,options)
.map(response =><IAmkaFill[]>response.json() )
.subscribe(res =>this.respond = res);
return this.respond;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment