added delete and merge option

This commit is contained in:
Philip Ellis
2024-01-24 13:53:38 -06:00
parent 034f358e8a
commit e1d23822b9
2 changed files with 65 additions and 2 deletions

View File

@@ -278,6 +278,21 @@ class Response {
} else {
return axiosResp.data
}
}).catch(function (error) {
console.log(error)
})
}
async update (response, responseId) {
return await this.axios.put(
`https://api.getpostman.com/collections/${this.collectionId}/responses/${responseId}`,
response
).then(function (axiosResp) {
if (axiosResp.status !== 200) {
throw new Error(`Error creating response ${response.id}: ${axiosResp.status} ${axiosResp.statusText}`)
} else {
return axiosResp.data
}
})
}