HackYourFuture-CPH / simply-name.it

Final Project for Class17
MIT License
3 stars 1 forks source link

Global fetch method #263

Closed NatsGt closed 3 years ago

NatsGt commented 3 years ago

Description

Fetch method that will work with GET, POST, PUT and DELETE

Fixes #216

How to test?

Set the environment on production (NODE_ENV=production) and test the fetch with the following parameters:

  1. endpoint (without /api/users/)
  2. method
  3. object to be passed to the body if is POST or PUT

Checklist

Midnighter commented 3 years ago

Sometimes the line annotations are bad, I meant a try catch around

const token = await getUserToken();