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
Merge requests
!23
Recipe view
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Recipe view
recipe-view
into
main
Overview
0
Commits
1
Pipelines
1
Changes
2
Merged
Katarzyna Szlejter
requested to merge
recipe-view
into
main
2 years ago
Overview
0
Commits
1
Pipelines
1
Changes
2
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
f3c2a47e
1 commit,
2 years ago
2 files
+
57
−
33
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/util/API.js
+
19
−
12
Options
@@ -352,18 +352,6 @@ export const API = {
@@ -352,18 +352,6 @@ export const API = {
.
catch
(
err
=>
{
console
.
log
(
err
)})
.
catch
(
err
=>
{
console
.
log
(
err
)})
},
},
// addIngredientsToFridge: async (ingredientIds) => {
// const authStore = useAuthStore();
// return axios.delete(`${import.meta.env.VITE_BACKEND_URL}/shoppinglist/purchased`, {
// headers: { Authorization: `Bearer ${authStore.token}`},
// data: { ingredientIds }
// })
// .then((response) => {return response.data})
// .catch(err => {console.log(err)})
// },
addIngredientsToFridge
:
async
(
ingredients
)
=>
{
addIngredientsToFridge
:
async
(
ingredients
)
=>
{
const
authStore
=
useAuthStore
();
const
authStore
=
useAuthStore
();
return
axios
.
put
(
`
${
import
.
meta
.
env
.
VITE_BACKEND_URL
}
/shoppinglist/purchased`
,
ingredients
,
{
return
axios
.
put
(
`
${
import
.
meta
.
env
.
VITE_BACKEND_URL
}
/shoppinglist/purchased`
,
ingredients
,
{
@@ -390,6 +378,25 @@ export const API = {
@@ -390,6 +378,25 @@ export const API = {
})
})
},
},
/**
* Remove ingredients from fridge based on a recipe
* @param request
*/
removeIngredientsFromFridge
:
(
request
)
=>
{
const
authStore
=
useAuthStore
();
axios
.
put
(
`
${
import
.
meta
.
env
.
VITE_BACKEND_URL
}
/fridge/ingredients`
,
request
,
{
headers
:
{
Authorization
:
"
Bearer
"
+
authStore
.
token
}
})
.
then
((
response
)
=>
{
console
.
log
(
response
);
})
.
catch
((
error
)
=>
{
throw
new
Error
(
error
);
})
},
/**
/**
* Deletes account from the
* Deletes account from the
Loading