Commit 5a26d6f9 authored by abbasmortezavifar's avatar abbasmortezavifar
Browse files

Update api adress

parent 2c2daa83
......@@ -11,6 +11,5 @@ export interface iSick{
date:string;
dateq:string;
perioddate:string;
created_at:string;
updated_at:string;
}
......@@ -25,6 +25,9 @@ export class PanelNewComponent implements OnInit {
this.http.chengeItem(id).subscribe((data) => (this.sicks = data));
}
ngOnInit(): void {
this.http.getItem().subscribe((date) => (this.sicks = date));
this.http.getItem().subscribe((date) => {
this.sicks = date;
console.log(date);
} );
}
}
......@@ -23,7 +23,6 @@
<label class="col-2 col-form-label">نوع </label>
<div class="col-4">
<select class="form-select" [(ngModel)]="selectedType" aria-label="Default select example">
<option [ngValue]="1"> ویزیت</option>
<option [ngValue]="2"> مشاوره</option>
<option [ngValue]="3"> موارد دیگر</option>
......
......@@ -11,34 +11,34 @@ export class ServerService {
constructor(private http:HttpClient) {}
sendItem(value: any) {
this.http.post('http://127.0.0.1:8000/api/store', value).subscribe(
this.http.post('http://127.0.0.1:8888/api/user', value).subscribe(
(response) => console.log(response),
(error) => console.log(error)
);
}
setQ(date: any):Observable<iSick[]> {
// this.http.post('http://127.0.0.1:8000/api/update', date).subscribe(
// (response) => console.log(response),
// (error) => console.log(error)
// );
return this.http.post<iSick[]>('http://127.0.0.1:8000/api/update', date).pipe(catchError(this.showError));
return this.http.post<iSick[]>('http://127.0.0.1:8888/api/user/registerSick', date).pipe(catchError(this.showError));
}
getItem(): Observable<iSick[]> {
return this.http
.get<iSick[]>('http://127.0.0.1:8000/api/sick')
.get<iSick[]>('http://127.0.0.1:8888/api/user')
.pipe(catchError(this.showError));
}
chengeItem(id: number): Observable<iSick[]> {
let url: string = 'http://127.0.0.1:8000/api/chenge/' + id;
let url: string = 'http://127.0.0.1:8888/api/user/' + id;
return this.http.get<iSick[]>(url).pipe(catchError(this.showError));
}
srhItem(value:string) {
let url: string = 'http://127.0.0.1:8000/api/serch/' + value;
let url: string = 'http://127.0.0.1:8888/api/user/' + value;
return this.http.get<iSick[]>(url).pipe(catchError(this.showError));
}
showError(errorResponse: HttpErrorResponse) {
......
Supports Markdown
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