Initial commit
This commit is contained in:
14
services/api.ts
Normal file
14
services/api.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export const apiService = {
|
||||
getUsers: async () => {
|
||||
const res = await fetch('https://jsonplaceholder.typicode.com/users');
|
||||
return res.json();
|
||||
},
|
||||
getPosts: async () => {
|
||||
const res = await fetch('https://jsonplaceholder.typicode.com/posts');
|
||||
return res.json();
|
||||
},
|
||||
getTodos: async () => {
|
||||
const res = await fetch('https://jsonplaceholder.typicode.com/todos');
|
||||
return res.json();
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user