[WIP] Фикс запросов, добавил валидацию основных данных

This commit is contained in:
megavrilinvv
2023-08-17 18:17:16 +03:00
parent 65918134ec
commit fbb89646ea
5 changed files with 26 additions and 37 deletions

View File

@@ -437,14 +437,11 @@ const actions = {
});
},
postUpdateAddress(context, { id, address, category }) {
fetchWrapper.post(`address/${id}`, {
fetchWrapper.patch(`address/${id}`, {
...address,
category: category,
});
},
deleteAddress(context, { id }) {
fetchWrapper.del(`address/${id}`);
},
postCreateContact(context, { obj, id }) {
fetchWrapper.post("contacts", {
person_id: id,
@@ -452,9 +449,7 @@ const actions = {
});
},
postUpdateContact(context, { obj, id }) {
fetchWrapper.post(`contacts/${id}`, {
...obj,
});
fetchWrapper.patch(`contacts/${id}`, obj);
},
deleteContact(context, { id }) {
fetchWrapper.del(`contacts/${id}`);