mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-02-04 16:18:32 -06:00
Replace variable declarations with destructuring
This commit is contained in:
@@ -122,20 +122,19 @@ class NetworkService {
|
||||
*/
|
||||
async requestHttp(job) {
|
||||
try {
|
||||
const url = job.data.url;
|
||||
const { url, secret, _id, teamId, type, jsonPath, matchMethod, expectedValue } = job.data;
|
||||
const config = {};
|
||||
|
||||
job.data.secret !== undefined &&
|
||||
(config.headers = { Authorization: `Bearer ${job.data.secret}` });
|
||||
secret !== undefined && (config.headers = { Authorization: `Bearer ${secret}` });
|
||||
|
||||
const { response, responseTime, error } = await this.timeRequest(() =>
|
||||
this.axios.get(url, config)
|
||||
);
|
||||
|
||||
const httpResponse = {
|
||||
monitorId: job.data._id,
|
||||
teamId: job.data.teamId,
|
||||
type: job.data.type,
|
||||
monitorId: _id,
|
||||
teamId,
|
||||
type,
|
||||
responseTime,
|
||||
payload: response?.data,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user