()
| 14 | .client(() => window.location.origin) |
| 15 | |
| 16 | export const usersQueryOptions = () => |
| 17 | queryOptions({ |
| 18 | queryKey: ['users'], |
| 19 | queryFn: () => |
| 20 | axios |
| 21 | .get<Array<User>>(getOrigin() + '/api/users') |
| 22 | .then((r) => r.data) |
| 23 | .catch(() => { |
| 24 | throw new Error('Failed to fetch users') |
| 25 | }), |
| 26 | }) |
| 27 | |
| 28 | export const userQueryOptions = (id: string) => |
| 29 | queryOptions({ |