user.ts 297 B

1234567891011121314151617
  1. export type User = {
  2. id: string
  3. firstName: string
  4. lastName: string
  5. name: string
  6. phone: string
  7. username: string
  8. email: string
  9. avatar: string
  10. }
  11. export type UserResponse = {
  12. users: User[]
  13. }
  14. export const fetchUsers = (url: string) =>
  15. fetch(url).then<UserResponse>(r => r.json())