Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DMWT_Season10_Group_2
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
Show more breadcrumbs
Sven Holm
DMWT_Season10_Group_2
Commits
f29c19e1
Commit
f29c19e1
authored
1 year ago
by
Tim-Luca Taxis
Browse files
Options
Downloads
Patches
Plain Diff
changed some language
parent
edbb40e4
No related branches found
No related tags found
1 merge request
!8
added automatic FruitList
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dmwt_session10/src/components/AddFruit.js
+2
-2
2 additions, 2 deletions
dmwt_session10/src/components/AddFruit.js
dmwt_session10/src/pages/API/add-fruit.js
+1
-1
1 addition, 1 deletion
dmwt_session10/src/pages/API/add-fruit.js
with
3 additions
and
3 deletions
dmwt_session10/src/components/AddFruit.js
+
2
−
2
View file @
f29c19e1
...
@@ -36,14 +36,14 @@ const AddFruit = () => {
...
@@ -36,14 +36,14 @@ const AddFruit = () => {
if
(
response
.
status
===
409
)
{
if
(
response
.
status
===
409
)
{
const
errorData
=
await
response
.
json
();
const
errorData
=
await
response
.
json
();
console
.
error
(
"
Fru
it already ad
de
d
"
);
console
.
error
(
"
Fru
cht schon vorhan
de
n
"
);
setError
(
errorData
.
error
);
setError
(
errorData
.
error
);
return
;
return
;
}
}
if
(
!
response
.
ok
)
{
if
(
!
response
.
ok
)
{
const
errorData
=
await
response
.
json
();
const
errorData
=
await
response
.
json
();
setError
(
errorData
.
error
||
'
F
ailed to add fruit
'
);
setError
(
errorData
.
error
||
'
F
ehler beim hinzufügen
'
);
return
;
return
;
}
}
...
...
This diff is collapsed.
Click to expand it.
dmwt_session10/src/pages/API/add-fruit.js
+
1
−
1
View file @
f29c19e1
...
@@ -18,7 +18,7 @@ export default async function handler(request, response) {
...
@@ -18,7 +18,7 @@ export default async function handler(request, response) {
if
(
existingFruit
.
rows
.
length
>
0
)
{
if
(
existingFruit
.
rows
.
length
>
0
)
{
return
response
.
status
(
409
).
json
({
error
:
'
Fru
it already added
'
});
return
response
.
status
(
409
).
json
({
error
:
'
Fru
cht schon vorhanden
'
});
}
}
const
result
=
await
sql
`
const
result
=
await
sql
`
...
...
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