Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
getAllUsers = async (): Promise<UserViewModel[]> => {
const url = `${this.apiEndpoint}/AllUsers`;
const response = await fetch(url);
const usersJson = await response.json();
const users = z.array(UserViewModelSchema).parse(usersJson);
return users;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment