Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EDB-Apo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Adrian Christian Beilharz
EDB-Apo
Commits
b362d6a4
Commit
b362d6a4
authored
4 years ago
by
AdrianBeilharz
Browse files
Options
Downloads
Patches
Plain Diff
revert to fix bugs
parent
b9c09810
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/components/apotheke/ApothekeBtmList.js
+17
-17
17 additions, 17 deletions
frontend/src/components/apotheke/ApothekeBtmList.js
frontend/src/components/btmbuch/BTMBuch.js
+16
-16
16 additions, 16 deletions
frontend/src/components/btmbuch/BTMBuch.js
with
33 additions
and
33 deletions
frontend/src/components/apotheke/ApothekeBtmList.js
+
17
−
17
View file @
b362d6a4
...
...
@@ -8,8 +8,9 @@ function ApothekeBtmList(props) {
const
[
btms
,
setBtms
]
=
useState
([]);
const
[
input
,
setInput
]
=
useState
(
""
);
const
getBtms
=
()
=>
{
fetch
(
`http://
${
process
.
env
.
REACT_APP_BACKEND_URL
}
/apotheke/
${
apoId
}
/btmbuchung`
,
const
getBtms
=
async
()
=>
{
const
response
=
await
fetch
(
`http://
${
process
.
env
.
REACT_APP_BACKEND_URL
}
/apotheke/
${
apoId
}
/btmbuchung`
,
{
method
:
"
GET
"
,
headers
:
{
...
...
@@ -17,26 +18,26 @@ function ApothekeBtmList(props) {
"
Bearer
"
+
window
.
sessionStorage
.
getItem
(
"
edbapo-jwt
"
),
},
}
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
setBtms
(
response
.
json
());
}
else
if
(
response
.
status
===
403
)
{
props
.
history
.
push
(
"
/forbidden
"
);
}
else
if
(
response
.
status
===
400
)
{
props
.
history
.
push
(
"
/badrequest
"
);
}
}).
catch
((
err
)
=>
{
).
catch
((
err
)
=>
{
//SHOW ERROR
return
;
});
if
(
response
.
status
===
200
)
{
setBtms
(
await
response
.
json
());
}
else
if
(
response
.
status
===
403
)
{
props
.
history
.
push
(
"
/forbidden
"
);
}
else
if
(
response
.
status
===
400
)
{
props
.
history
.
push
(
"
/badrequest
"
);
}
};
//wird aufgerufen von NeuesBtmModal wenn ein neues BTM hinzugefügt wurde
props
.
apothekeRefFunctions
.
updateBtmList
=
getBtms
;
useEffect
(
getBtms
,
[
apoId
,
props
.
history
]);
useEffect
(()
=>
{
getBtms
();
},
[]);
return
(
<
div
className
=
"
btm-buchung-wrapper
"
>
...
...
@@ -53,12 +54,11 @@ function ApothekeBtmList(props) {
.
filter
((
val
)
=>
{
if
(
input
===
""
)
{
return
val
;
}
else
if
(
val
.
btm
.
name
.
toLowerCase
().
includes
(
input
.
toLowerCase
()))
{
return
val
;
}
else
if
(
val
.
btm
.
name
.
toLowerCase
().
includes
(
input
.
toLowerCase
())){
return
val
;
}
return
null
;
})
.
map
((
btm
)
=>
(
.
map
((
btm
,
key
)
=>
(
<
BuchungTabelle
{...
props
}
btm
=
{
btm
}
/>
))}
<
/div>
...
...
This diff is collapsed.
Click to expand it.
frontend/src/components/btmbuch/BTMBuch.js
+
16
−
16
View file @
b362d6a4
...
...
@@ -15,33 +15,33 @@ function BTMBuch (props) {
const
[
isLoggedIn
,
setLoggedIn
]
=
useState
(
false
);
const
[
aktiveRolle
,
setAktiveRolle
]
=
useState
(
''
);
const
getUserDetails
=
event
=>
{
fetch
(
`http://
${
process
.
env
.
REACT_APP_BACKEND_URL
}
/benutzer/me`
,
{
const
getUserDetails
=
async
event
=>
{
const
response
=
await
fetch
(
`http://
${
process
.
env
.
REACT_APP_BACKEND_URL
}
/benutzer/me`
,
{
method
:
'
GET
'
,
headers
:
{
'
Authorization
'
:
'
Bearer
'
+
window
.
sessionStorage
.
getItem
(
"
edbapo-jwt
"
),
}
}).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
let
u
=
response
.
json
();
console
.
log
(
JSON
.
stringify
(
u
))
setUser
(
u
);
setAktiveRolle
(
u
.
rolle
);
setLoggedIn
(
true
);
}
else
if
(
response
.
status
===
403
)
{
props
.
history
.
push
(
'
/forbidden
'
);
}
else
if
(
response
.
status
===
400
){
props
.
history
.
push
(
'
/badrequest
'
);
}
}).
catch
((
err
)
=>
{
//SHOW ERROR
return
;
});
if
(
response
.
status
===
200
)
{
let
u
=
await
response
.
json
();
console
.
log
(
JSON
.
stringify
(
u
))
setUser
(
u
);
setAktiveRolle
(
u
.
rolle
);
setLoggedIn
(
true
);
}
else
if
(
response
.
status
===
403
)
{
props
.
history
.
push
(
'
/forbidden
'
);
}
else
if
(
response
.
status
===
400
){
props
.
history
.
push
(
'
/badrequest
'
);
}
}
useEffect
(
getUserDetails
,
[
apoId
,
props
.
history
])
useEffect
(()
=>
{
getUserDetails
();
},
[])
//this obj is passed to each child, each child can add functions to this object and call functions from this object
let
apothekeRefFunctions
=
{}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment