import axios from 'axios';
import * as fs from 'fs';
import * as FormData from 'form-data';

async function uploadTest() {
  const form = new FormData();
  fs.writeFileSync('test_resume.pdf', 'dummy content');
  form.append('resume', fs.createReadStream('test_resume.pdf'), 'test_resume.pdf');
  form.append('seeker_id', 3565);

  try {
    const res = await axios.post('http://localhost:4001/seeker_resumes/upload', form, {
      headers: {
        ...form.getHeaders(),
        // Add fake auth token or disable auth in controller temporarily?
      }
    });
    console.log(res.data);
  } catch (e: any) {
    console.error(e.response?.data || e.message);
  }
}

uploadTest();
