/* eslint-disable @typescript-eslint/no-var-requires */ const axios = require('axios'); const path = require('path'); require('dotenv').config({ path: path.resolve(__dirname, '../.env') }); axios .post('http://localhost:3000/api/auth/login', { email: 'admin@admin.com', password: process.env.USER_PWD, }) .then((res) => { const config = { headers: { Authorization: `Bearer ${res.data.accessToken}` }, }; axios .post('http://localhost:3000/api/structures/resetSearchIndex', {}, config) .then((res) => { console.log(`Structures | statusCode: ${res.status}`); }) .catch((error) => { console.error('Error in structure search reset'); console.error(error); }); axios .post('http://localhost:3000/api/employer/searchIndex', {}, config) .then((res) => { console.log(`Employers | statusCode: ${res.status}`); }) .catch((error) => { console.error('Error in employer search reset'); console.error(error); }); axios .post('http://localhost:3000/api/userRegistry/searchIndex', {}, config) .then((res) => { console.log(`Users | statusCode: ${res.status}`); }) .catch((error) => { console.error('Error in user search reset'); console.error(error); }); }) .catch((error) => { console.error('Error in auth'); console.error(error); });