CEC-4525: add support for /tags endpoint and implement a new action for it (#361)
* add action for adding tags
This commit is contained in:
@@ -17,6 +17,18 @@ const vehiclesAPI = {
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler),
|
||||
|
||||
addTags: async (vins, tags, token) =>
|
||||
fetch(`${API_ENDPOINT}/tags`, {
|
||||
method: "PUT",
|
||||
headers: Object.assign(
|
||||
{ "Content-Type": "application/json" },
|
||||
getAuthHeaderOptions(token),
|
||||
),
|
||||
body: JSON.stringify({ vins, tags }),
|
||||
})
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler),
|
||||
|
||||
deleteVehicle: async (vin, token) =>
|
||||
fetch(`${API_ENDPOINT}/vehicle/${vin}`, {
|
||||
method: "DELETE",
|
||||
|
||||
Reference in New Issue
Block a user