Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fiqryq committed Aug 22, 2022
1 parent 96ce528 commit d2a7d09
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,55 +15,6 @@ npm run dev
- Integrate with [Tailwind CSS](https://tailwindcss.com/)
- Prettier plugin tailwindcss
- SEO with tag Next `<Head/>`
- Fetcher utils

## Utils Usage

`fetch.ts`

```ts
// GET
fetchData: async () => {
const options = {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: '',
},
url: 'https://yourendpoint.com',
};

fetch(options)
.then((response) => {
console.log(response);
})
.catch((err: any) => {
console.log(err);
});
},

// POST
createData: async (payload: any) => {
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
'Accept-Language': 'id',
Authorization: ''
},
url: 'https://yourendpoint.com',
data: payload,
};
fetch(options)
.then((response) => {
console.log(response)
})
.catch((err: any) => {
console.log(err)
});
},
```

### Folder Structure

Expand Down

0 comments on commit d2a7d09

Please sign in to comment.