@radio-retail/api-client
Advanced tools
Comparing version 1.0.38 to 1.0.39
@@ -43,3 +43,3 @@ const getData = require('../utils/get-raw-data'); | ||
removeContactsFromClient(clientId, data) { | ||
return instance.delete(`${baseRoute}/clients/${clientId}/contacts`, { | ||
return instance.delete(`${baseRoute}/${clientId}/contacts`, { | ||
data | ||
@@ -119,3 +119,3 @@ }); | ||
removeContactsFromAccount(clientId, accountId, data) { | ||
return instance.delete(`${baseRoute}/clients/${clientId}/accounts/${accountId}/contacts`, { | ||
return instance.delete(`${baseRoute}/${clientId}/accounts/${accountId}/contacts`, { | ||
data | ||
@@ -204,3 +204,3 @@ }); | ||
removeContactsFromStore(clientId, accountId, storeId, data) { | ||
return instance.delete(`${baseRoute}/clients/${clientId}/accounts/${accountId}/stores/${storeId}/contacts`, { | ||
return instance.delete(`${baseRoute}/${clientId}/accounts/${accountId}/stores/${storeId}/contacts`, { | ||
data | ||
@@ -211,4 +211,4 @@ }); | ||
// Store-lists | ||
createStoreList(clientId, accountId, data, config = {}) { | ||
return instance.post(`${baseRoute}/${clientId}/accounts/${accountId}/storelists`, data, config).then(getData(config.raw)); | ||
createStoreList(clientId, data, config = {}) { | ||
return instance.post(`${baseRoute}/${clientId}/storelists`, data, config).then(getData(config.raw)); | ||
}, | ||
@@ -218,25 +218,25 @@ | ||
config.params = params; | ||
return instance.get(`${baseRoute}/${clientId}/accounts/${accountId}/storelists`, config).then(getData(config.raw)); | ||
return instance.get(`${baseRoute}/${clientId}/storelists`, config).then(getData(config.raw)); | ||
}, | ||
getAllStoresFromStoreList(clientId, accountId, storeListId, params, config = {}) { | ||
getAllStoresFromStoreList(clientId, storeListId, params, config = {}) { | ||
config.params = params; | ||
return instance.get(`${baseRoute}/${clientId}/accounts/${accountId}/storelists/${storeListId}/stores`, config).then(getData(config.raw)); | ||
return instance.get(`${baseRoute}/${clientId}/storelists/${storeListId}/stores`, config).then(getData(config.raw)); | ||
}, | ||
getAllStoreListCount(params, config = {}) { | ||
getAllStoreListCount(clientId, params, config = {}) { | ||
config.params = params; | ||
return instance.get(`${baseRoute}/${clientId}/accounts/${accountId}/storelists/count`, config).then(getData(config.raw)); | ||
return instance.get(`${baseRoute}/${clientId}/storelists/count`, config).then(getData(config.raw)); | ||
}, | ||
getStoreListsQuery(clientId, accountId, query, params, config = {}) { | ||
getStoreListsQuery(clientId, query, params, config = {}) { | ||
config.params = params; | ||
return instance.get(`${baseRoute}/${clientId}/accounts/${accountId}/storelists/search?query=${query}`, config).then(getData(config.raw)); | ||
return instance.get(`${baseRoute}/${clientId}/storelists/search?query=${query}`, config).then(getData(config.raw)); | ||
}, | ||
deleteStoreList(clientId, accountId, storeListId) { | ||
return instance.delete(`${baseRoute}/${clientId}/accounts/${accountId}/storelists/${storeListId}`); | ||
deleteStoreList(clientId, storeListId) { | ||
return instance.delete(`${baseRoute}/${clientId}/storelists/${storeListId}`); | ||
}, | ||
patchStoreList(clientId, accountId, storeListId, body, prevConfig = {}, extractNestedData = true) { | ||
patchStoreList(clientId, storeListId, body, prevConfig = {}, extractNestedData = true) { | ||
const config = { | ||
@@ -248,3 +248,3 @@ headers: { | ||
}; | ||
return instance.patch(`${baseRoute}/${clientId}/accounts/${accountId}/storelists/${storeListId}`, body, config).then(getData(!extractNestedData)); | ||
return instance.patch(`${baseRoute}/${clientId}/storelists/${storeListId}`, body, config).then(getData(!extractNestedData)); | ||
}, | ||
@@ -251,0 +251,0 @@ |
{ | ||
"name": "@radio-retail/api-client", | ||
"description": "Radio Retail API client", | ||
"version": "1.0.38", | ||
"version": "1.0.39", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
16351