filtro em produtos, bug tela de preparo, nome do user nas comandas e itens
This commit is contained in:
16
test-api.ts
Normal file
16
test-api.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
(async () => {
|
||||
const res = await fetch('http://localhost:3333/api/auth/login', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ email: 'admin@gastrobar.com', senha: '123456' }),
|
||||
});
|
||||
const data = await res.json();
|
||||
console.log('TOKEN:', data.token);
|
||||
|
||||
const res2 = await fetch('http://localhost:3333/api/comandas?status=ABERTA,FECHADA', {
|
||||
headers: { Authorization: `Bearer ${data.token}` },
|
||||
});
|
||||
const data2 = await res2.json();
|
||||
console.log('COMANDAS STATUS:', res2.status);
|
||||
console.log('COMANDAS:', JSON.stringify(data2, null, 2));
|
||||
})();
|
||||
Reference in New Issue
Block a user