Created
July 9, 2022 15:00
-
-
Save dsibinski/b49678cb4bb3d9ed23b9e59ecd58b595 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class UsersService { | |
private apiEndpoint: string; | |
constructor() { | |
this.apiEndpoint = "https://localhost:7131/Users"; | |
} | |
getAllUsers = async (): Promise<UserViewModel[]> => { | |
const url = `${this.apiEndpoint}/AllUsers`; | |
const response = await fetch(url); | |
const users = (await response.json()) as UserViewModel[]; | |
return users; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment