37 lines
770 B
TypeScript
37 lines
770 B
TypeScript
import { Injectable } from '@angular/core';
|
|
|
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
import { Observable } from 'rxjs/Observable';
|
|
import 'rxjs/add/operator/map';
|
|
|
|
@Injectable()
|
|
export class RegistrationService {
|
|
|
|
APIURL = "http://192.241.155.78/ludosdata/api.php";
|
|
|
|
constructor(
|
|
private http: HttpClient
|
|
){ }
|
|
|
|
/*
|
|
validateUserName( userName ): Observable<any> {
|
|
return this.http.get( "http://www.pugludos.com/registration.php?key=validation&type=username&value=" + userName )
|
|
.map(res => {
|
|
return(
|
|
res
|
|
);
|
|
});
|
|
}
|
|
*/
|
|
|
|
validateUserName( userName ): Observable<any> {
|
|
return this.http.get( this.APIURL + "/users?filter=email,cs," + userName + "&transform=1" )
|
|
.map(res => {
|
|
return(
|
|
res
|
|
);
|
|
});
|
|
}
|
|
|
|
}
|