UNPKG

r6-data.js

Version:

Rainbow Six Siege API wrapper for player's stats, maps, operators, ranks, seasons, charms etc. Last updated Y10S3

21 lines (16 loc) 652 B
const axiosInstance = require('../axiosInstance/axiosInstance'); const buildUrlAndParams = require('./util'); async function getMaps({ name, location, releaseDate, playlists, mapReworked } = {}) { try { const url = buildUrlAndParams('/maps', { name, location, releaseDate, playlists, mapReworked }); const response = await axiosInstance.get(url); return response.data; } catch (error) { console.error('Error during the getMaps request:', error.message); if (error.response && error.response.status === 401) { throw new Error('request error'); } throw error; } } module.exports = getMaps;