Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mortezavifar
Queuing2
Commits
5a26d6f9
Commit
5a26d6f9
authored
Jul 06, 2021
by
abbasmortezavifar
Browse files
Update api adress
parent
2c2daa83
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/app/ISick.ts
View file @
5a26d6f9
...
...
@@ -11,6 +11,5 @@ export interface iSick{
date
:
string
;
dateq
:
string
;
perioddate
:
string
;
created_at
:
string
;
updated_at
:
string
;
}
src/app/admin/panel-new/panel-new.component.ts
View file @
5a26d6f9
...
...
@@ -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
);
}
);
}
}
src/app/admin/panel-ok/panel-ok.component.html
View file @
5a26d6f9
...
...
@@ -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>
...
...
src/app/server.service.ts
View file @
5a26d6f9
...
...
@@ -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:8
000
/api/
sick
'
)
.
get
<
iSick
[]
>
(
'
http://127.0.0.1:8
888
/api/
user
'
)
.
pipe
(
catchError
(
this
.
showError
));
}
chengeItem
(
id
:
number
):
Observable
<
iSick
[]
>
{
let
url
:
string
=
'
http://127.0.0.1:8
000
/api/
chenge
/
'
+
id
;
let
url
:
string
=
'
http://127.0.0.1:8
888
/api/
user
/
'
+
id
;
return
this
.
http
.
get
<
iSick
[]
>
(
url
).
pipe
(
catchError
(
this
.
showError
));
}
srhItem
(
value
:
string
)
{
let
url
:
string
=
'
http://127.0.0.1:8
000
/api/ser
ch
/
'
+
value
;
let
url
:
string
=
'
http://127.0.0.1:8
888
/api/
u
ser/
'
+
value
;
return
this
.
http
.
get
<
iSick
[]
>
(
url
).
pipe
(
catchError
(
this
.
showError
));
}
showError
(
errorResponse
:
HttpErrorResponse
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment