fix: thêm thành viên ngoài hệ thống vào Tour
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
async function test() {
|
||||
const loginRes = await fetch('http://localhost:3001/api/v1/auth/login', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ email: 'photomember@travel.com', password: '123456' })
|
||||
});
|
||||
const loginData = await loginRes.json();
|
||||
|
||||
if (loginRes.ok) {
|
||||
const token = loginData.access_token;
|
||||
const usersRes = await fetch('http://localhost:3001/api/v1/users?q=owner@travel.com', {
|
||||
headers: { 'Authorization': `Bearer ${token}` }
|
||||
});
|
||||
console.log('Users status:', usersRes.status);
|
||||
const usersData = await usersRes.json();
|
||||
console.log('Users data:', usersData);
|
||||
} else {
|
||||
console.error('Login failed:', loginData);
|
||||
}
|
||||
}
|
||||
|
||||
test().catch(console.error);
|
||||
Reference in New Issue
Block a user