Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
IDATT2106 Scrum Team 02
Frontend
Commits
8794af1f
Commit
8794af1f
authored
2 years ago
by
Ingrid Martinsheimen Egge
Browse files
Options
Downloads
Patches
Plain Diff
Oppdaterte api metode, slik at amn kan fjerne ting fra kjøleskap
parent
d10f7421
No related branches found
No related tags found
1 merge request
!13
Fridge view
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/EatFridgeItemModal.vue
+6
-2
6 additions, 2 deletions
src/components/EatFridgeItemModal.vue
src/util/API.js
+2
-2
2 additions, 2 deletions
src/util/API.js
with
8 additions
and
4 deletions
src/components/EatFridgeItemModal.vue
+
6
−
2
View file @
8794af1f
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<p
id=
"sliderDisplay"
>
{{
sliderValue
}}
{{
this
.
fridgeItem
.
amount
.
unit
}}
</p>
<p
id=
"sliderDisplay"
>
{{
sliderValue
}}
{{
this
.
fridgeItem
.
amount
.
unit
}}
</p>
<label
for=
"slider"
>
Mengde tatt av varen:
</label>
<label
for=
"slider"
>
Mengde tatt av varen:
</label>
<input
type =
"range"
id =
"slider"
name =
"slider"
min=
"0"
:max =
"this.maxValue"
v-model=
"sliderValue"
>
<input
type =
"range"
id =
"slider"
name =
"slider"
min=
"0"
:max =
"this.maxValue"
step=
"this.stepIncrentValue"
v-model=
"sliderValue"
>
<div
id=
"buttons"
>
<div
id=
"buttons"
>
<button
@
click=
"logFoodAsDiscarded"
>
Ble kastet
</button>
<button
@
click=
"logFoodAsDiscarded"
>
Ble kastet
</button>
...
@@ -38,6 +38,7 @@ export default {
...
@@ -38,6 +38,7 @@ export default {
return
{
return
{
visible
:
true
,
visible
:
true
,
sliderValue
:
0
,
sliderValue
:
0
,
stepIncrentValue
:
'
1
'
,
}
}
},
},
methods
:{
methods
:{
...
@@ -58,7 +59,7 @@ export default {
...
@@ -58,7 +59,7 @@ export default {
}
}
};
};
API
.
removeIngredientFrom
Fridge
(
request
).
catch
((
error
)
=>
console
.
log
(
error
));
API
.
update
Fridge
(
request
).
catch
((
error
)
=>
console
.
log
(
error
));
this
.
close
();
this
.
close
();
},
},
logFoodAsDiscarded
(){
logFoodAsDiscarded
(){
...
@@ -98,6 +99,9 @@ export default {
...
@@ -98,6 +99,9 @@ export default {
return
numOfDays
<
1
;
return
numOfDays
<
1
;
},
},
getStep
(){
return
0.1
;
},
}
}
}
}
</
script
>
</
script
>
...
...
This diff is collapsed.
Click to expand it.
src/util/API.js
+
2
−
2
View file @
8794af1f
...
@@ -191,10 +191,10 @@ export const API = {
...
@@ -191,10 +191,10 @@ export const API = {
* Action available: CONSUMED, DISCARDED,ADDED_TO_FRIDGE
* Action available: CONSUMED, DISCARDED,ADDED_TO_FRIDGE
* @returns {Promise<void>}
* @returns {Promise<void>}
*/
*/
removeIngredientFrom
Fridge
:
async
(
request
)
=>
{
update
Fridge
:
async
(
request
)
=>
{
const
authStore
=
useAuthStore
();
const
authStore
=
useAuthStore
();
axios
.
put
(
`
${
import
.
meta
.
env
.
VITE_BACKEND_URL
}
/fridge/ingredients`
,
request
,{
axios
.
put
(
`
${
import
.
meta
.
env
.
VITE_BACKEND_URL
}
/fridge/ingredients
Amount
`
,
request
,{
headers
:
{
Authorization
:
`Bearer
${
authStore
.
token
}
`
},
headers
:
{
Authorization
:
`Bearer
${
authStore
.
token
}
`
},
}).
then
((
response
)
=>
{
}).
then
((
response
)
=>
{
return
response
.
data
;
return
response
.
data
;
...
...
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