Commiting work
This commit is contained in:
@@ -293,6 +293,13 @@ export const profileApi = {
|
||||
getProtectedData() {
|
||||
return requestJson('/api/profile/data')
|
||||
},
|
||||
|
||||
updateProfile(payload) {
|
||||
return requestJson('/api/profile', {
|
||||
method: 'PUT',
|
||||
body: payload,
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
export const locationsApi = {
|
||||
@@ -300,6 +307,10 @@ export const locationsApi = {
|
||||
return requestJson('/api/locations')
|
||||
},
|
||||
|
||||
getLocationHistory(id) {
|
||||
return requestJson(`/api/locations/${id}/history`)
|
||||
},
|
||||
|
||||
createLocation(payload) {
|
||||
return requestJson('/api/locations', {
|
||||
method: 'POST',
|
||||
@@ -366,6 +377,10 @@ export const householdsApi = {
|
||||
return requestJson('/api/households')
|
||||
},
|
||||
|
||||
getHouseholdHistory(id) {
|
||||
return requestJson(`/api/households/${id}/history`)
|
||||
},
|
||||
|
||||
createHousehold(payload) {
|
||||
return requestJson('/api/households', {
|
||||
method: 'POST',
|
||||
@@ -398,4 +413,75 @@ export const usersApi = {
|
||||
getUsers() {
|
||||
return requestJson('/api/users')
|
||||
},
|
||||
|
||||
getUser(id) {
|
||||
return requestJson(`/api/users/${id}`)
|
||||
},
|
||||
|
||||
updateUser(id, payload) {
|
||||
return requestJson(`/api/users/${id}`, {
|
||||
method: 'PUT',
|
||||
body: payload,
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
export const shoppingListsApi = {
|
||||
getShoppingLists() {
|
||||
return requestJson('/api/shoppinglists')
|
||||
},
|
||||
|
||||
getShoppingList(id) {
|
||||
return requestJson(`/api/shoppinglists/${id}`)
|
||||
},
|
||||
|
||||
createShoppingList(payload) {
|
||||
return requestJson('/api/shoppinglists', {
|
||||
method: 'POST',
|
||||
body: payload,
|
||||
})
|
||||
},
|
||||
|
||||
updateShoppingList(id, payload) {
|
||||
return requestJson(`/api/shoppinglists/${id}`, {
|
||||
method: 'PUT',
|
||||
body: payload,
|
||||
})
|
||||
},
|
||||
|
||||
deleteShoppingList(id) {
|
||||
return requestJson(`/api/shoppinglists/${id}`, {
|
||||
method: 'DELETE',
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
export const mealPlannersApi = {
|
||||
getMealPlanners() {
|
||||
return requestJson('/api/mealplanners')
|
||||
},
|
||||
|
||||
getMealPlanner(id) {
|
||||
return requestJson(`/api/mealplanners/${id}`)
|
||||
},
|
||||
|
||||
createMealPlanner(payload) {
|
||||
return requestJson('/api/mealplanners', {
|
||||
method: 'POST',
|
||||
body: payload,
|
||||
})
|
||||
},
|
||||
|
||||
updateMealPlanner(id, payload) {
|
||||
return requestJson(`/api/mealplanners/${id}`, {
|
||||
method: 'PUT',
|
||||
body: payload,
|
||||
})
|
||||
},
|
||||
|
||||
deleteMealPlanner(id) {
|
||||
return requestJson(`/api/mealplanners/${id}`, {
|
||||
method: 'DELETE',
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user