-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-salary-api.js
More file actions
34 lines (29 loc) · 1 KB
/
test-salary-api.js
File metadata and controls
34 lines (29 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Simple Node.js script to test salary submission
const fetch = require('node-fetch');
async function testSalarySubmission() {
try {
console.log('Testing salary submission...');
// Test with the first user we saw in the debug data: aiyad.zamir@gmail.com
const response = await fetch('http://localhost:3000/api/users/salary', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
// Note: In a real scenario, this would need proper authentication
'Authorization': 'Bearer your-auth-token'
},
body: JSON.stringify({
monthlySalary: 5000,
hourlyRate: 28.9
})
});
if (response.ok) {
const result = await response.json();
console.log('✅ Salary submission successful:', result);
} else {
console.log('❌ Salary submission failed:', response.status, await response.text());
}
} catch (error) {
console.error('Error testing salary submission:', error.message);
}
}
testSalarySubmission();